Mac Developer Library

Developer

Foundation Framework Reference NSScriptSuiteRegistry Class Reference

Options
Deployment Target:

On This Page
Language:

NSScriptSuiteRegistry

NSScriptSuiteRegistry functions as the top-level repository of scriptability information for an application at runtime. More...

Inheritance


Conforms To


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.0 and later.
  • Sets the single, shared instance of NSScriptSuiteRegistry to registry.

    Declaration

    Swift

    class func setSharedScriptSuiteRegistry(_ registry: NSScriptSuiteRegistry)

    Objective-C

    + (void)setSharedScriptSuiteRegistry:(NSScriptSuiteRegistry *)registry

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    class func sharedScriptSuiteRegistry() -> NSScriptSuiteRegistry

    Objective-C

    + (NSScriptSuiteRegistry *)sharedScriptSuiteRegistry

    Discussion

    If it creates an instance, and if the application provides scriptability information in the script suite format, the method loads suite definitions in all frameworks and other bundles that the application currently imports or includes; if information is provided in the sdef format, the method loads information only from the specified sdef file. If in reading scriptability information an exception is raised because of parsing errors, it handles the exception by printing a line of information to the console.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the name of the suite definition associated with the given four-character Apple event code, code.

    Declaration

    Swift

    func suiteForAppleEventCode(_ appleEventCode: FourCharCode) -> String?

    Objective-C

    - (NSString *)suiteForAppleEventCode:(FourCharCode)appleEventCode

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

    See Also

    – suiteNames

  • Returns the names of the suite definitions currently loaded by the application.

    Declaration

    Swift

    var suiteNames: [AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSArray *suiteNames

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns an NSData object that contains data in 'aete' resource format describing the scriptability information currently known to the application.

    Declaration

    Swift

    func aeteResource(_ languageName: String) -> NSData?

    Objective-C

    - (NSData *)aeteResource:(NSString *)languageName

    Discussion

    This method is typically invoked to implement the get aete Apple event for an application that provides scriptability information in the script suite format. The languageName argument is the name of a language for which a localized resource directory (such as English.lproj) exists. This language indication specifies the set of .scriptTerminology files to be used to generate the data. NSScriptSuiteRegistry does not create an 'aete' resource unless this method is called.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the Apple event code associated with the suite named suiteName, such as ‘core’ for the Core suite.

    Declaration

    Swift

    func appleEventCodeForSuite(_ suiteName: String) -> FourCharCode

    Objective-C

    - (FourCharCode)appleEventCodeForSuite:(NSString *)suiteName

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the bundle containing the suite-definition property list (extension .scriptSuite) identified by suiteName.

    Declaration

    Swift

    func bundleForSuite(_ suiteName: String) -> NSBundle?

    Objective-C

    - (NSBundle *)bundleForSuite:(NSString *)suiteName

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • 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 loadSuiteWithDictionary(_ suiteDeclaration: [NSObject : AnyObject], fromBundle bundle: NSBundle)

    Objective-C

    - (void)loadSuiteWithDictionary:(NSDictionary *)suiteDeclaration fromBundle:(NSBundle *)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 class method registerClassDescription:forClass:. 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.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Loads the suite definitions in bundle aBundle, invoking loadSuiteWithDictionary:fromBundle: for each suite found.

    Declaration

    Swift

    func loadSuitesFromBundle(_ bundle: NSBundle)

    Objective-C

    - (void)loadSuitesFromBundle:(NSBundle *)bundle

    Discussion

    If errors occur while method is parsing a suite-definition file, the method logs error messages to the console.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.