---
title: "loadSuite(with:from:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsscriptsuiteregistry/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.

## Declaration

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

## Discussion

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 class method 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

### Related Documentation

- [register(_:)](foundation/nsscriptsuiteregistry/register(_:)-9aplw.md)
- [shared()](foundation/nsscriptsuiteregistry/shared().md)
- [register(_:)](foundation/nsscriptsuiteregistry/register(_:)-5mq91.md)

### Loading Suites

- [loadSuites(from:)](foundation/nsscriptsuiteregistry/loadsuites(from:).md)
