<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSScriptSuiteRegistry/loadSuite(with:from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScriptSuiteRegistry(im)loadSuiteWithDictionary:fromBundle:"
  },
  "title" : "loadSuite(with:from:)"
}
-->

# loadSuite(with:from:)

Loads the suite definition encapsulated in `dictionary`; previously, this suite definition was parsed from a `.scriptSuite` property list contained in a framework or in `bundle`.

```
func loadSuite(with suiteDeclaration: [AnyHashable : Any], from bundle: Bundle)
```

## Discussion

The method extracts information from the dictionary and caches it in various internal collection objects. If keys are missing or values are of the wrong type, it logs messages to the console. It also registers class descriptions and command descriptions. In registering a class description, it invokes the [`NSClassDescription`](/documentation/Foundation/NSClassDescription) class method [`register(_:for:)`](/documentation/Foundation/NSClassDescription/register(_:for:)). In registering a command description, it arranges for the Apple event translator to handle incoming Apple events that represent the defined commands.

This method is invoked when the shared instance is initialized and when bundles are loaded at runtime. Prior to invoking it, `NSScriptSuiteRegistry` creates the dictionary argument from the `.scriptSuite` property list. If you invoke this method in your code, you should try to do it before the application receives its first Apple event.

## See Also

[`-  registerClassDescription:`](/documentation/Foundation/NSScriptSuiteRegistry/register(_:)-9aplw)

Registers class description `classDescription` for use by Cocoa’s built-in scripting support by storing it in a per-suite internal dictionary under the class name.

[`+  sharedScriptSuiteRegistry`](/documentation/Foundation/NSScriptSuiteRegistry/shared())

Returns the single, shared instance of `NSScriptSuiteRegistry`, creating it first if it doesn’t exist.

[`-  registerCommandDescription:`](/documentation/Foundation/NSScriptSuiteRegistry/register(_:)-5mq91)

Registers command description `commandDesc` for use by Cocoa’s built-in scripting support by storing it in a per-suite internal dictionary under the command name.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)