You provide scriptability information for your application in one of the two formats described in “Scriptability Information Formats”:
The scripting definition (or sdef) format first became available in Mac OS X version 10.2. Cocoa scripting can interpret sdef files natively starting in Mac OS X version 10.4.
For Mac OS X version 10.3, an sdef file can be converted to a corresponding script suite and script terminology file pair.
The script suite format, consisting of a script suite file and a corresponding script terminology file, has been in use since scriptability support first became available in Cocoa and works in any version. This is the only format Cocoa scripting can interpret natively prior to Mac OS X version 10.4.
The traditional Carbon mechanism for supplying scriptability information is the 'aete' resource file. Cocoa scripting doesn't use 'aete' resources, but you can add one to your application to control how your scriptability information is displayed by Script Editor or other dictionary viewers. Starting in Mac OS version 10.4, however, the preferred mechanism for controlling how your scriptability information is displayed is to use an sdef file.
Advantages of the Scripting Definition Format
Advantages of the Script Suite Format
Important: You can read about additional refinements to sdef usage in Cocoa applications for Mac OS X v10.5 in the Scripting section of Foundation Release Notes.
There are a number of advantages to using the native sdef format in Mac OS X version 10.4, including:
You can assemble information describing the terminology and implementation details for your application all in one file, so there is no need to synchronize separate files.
You have more options for specifying scriptability information. For example, you can control the order in which information is displayed (without having to add an 'aete' resource to your application). You can also use the hidden attribute to hide deprecated terms while still keeping them available for backward compatibility. Or you can hide terms that are not yet ready for release.
With an sdef, only the parts of Cocoa’s default scriptability information that you specifically include are used by Cocoa scripting and are visible when your dictionary is displayed.
By comparison, applications that use only script suite and script terminology files will include the terminology from all such files defined in any framework the application links to or bundles that it loads (including the files for the full Standard and Text suites defined in the Cocoa framework).
Script Editor can display your application’s dictionary without launching the application. However, through Mac OS X version 10.4, it does still need to open your application to compile a script that targets the application.
The main advantage of the script suite format is that it can be used in any scriptable version of Cocoa. If your scriptable application will run in versions of the Mac OS prior to version 10.4, it must include script suite and script terminology files. However, it can also contain an sdef file, so that it can gain the advantages that sdef files provide when running in Mac OS X version 10.4.
Script suite and script terminology files do not allow detailed control of how your scriptability information is displayed in a dictionary viewer. But if you need finer control of the look of your dictionary, you can add an 'aete' resource to your application bundle. You can generate the 'aete' by creating an sdef file for your application, then using the sdp tool to create an 'aete' resource. Or you can create an 'aete' resource directly (some third party tools can aid in doing so).
Suite information is described in detail in “Script Suite and Script Terminology Files.”
Last updated: 2008-03-11