A script terminology file maps AppleScript terminology—the English-like words and phrases a scripter can use in a script, such as the first word in the first paragraph—to the class and command descriptions in a script suite file. A script terminology file also provides valuable documentation about an application’s scripting support, which users can examine in the Script Editor and Xcode applications.
Note: If an application also includes an 'aete' resource, Script Editor displays the contents of that resource instead of the script terminology. (In Mac OS X version 10.4 and later, if an application uses an sdef file, any 'aete' file is ignored.)
Like a script suite file, a script terminology file is stored as a nested list of key-value pairs. Script terminologies are always property lists, but in addition they must conform to the format described in “The Structure of a Script Terminology File.” See “Creating Your Own Script Suite Files” for information on how to create and edit these files.
Note: English is currently the only supported dialect in AppleScript. It is not recommended that you localize your terminology for other languages.
Listing B-2 shows the terminology for the NSApplication class, taken from NSCoreSuite.scriptTerminology, the script terminology file for the Standard suite (provided by Cocoa). The terminology is shown as exported in “ASCII Property List File” format by the Property List Editor application. You can find the full version of this file on your system by following the Resources symbolic link at /System/Library/Frameworks/Foundation.framework.
Listing B-2 NSApplication class from the script terminology file for the Standard suite
NSApplication = { |
Attributes = { |
isActive = { |
Description = "Is this the frontmost (active) application?"; |
Name = frontmost; |
}; |
name = {Description = "The name of the application."; Name = name; }; |
version = {Description = "The version of the application."; Name = version; }; |
}; |
Description = "An application's top level scripting object."; |
Name = application; |
PluralName = applications; |
}; |
NSColor = {Description = "A color."; Name = color; PluralName = colors; }; |
NSDocument = { |
Attributes = { |
fileName = {Description = "The document's path."; Name = path; }; |
isDocumentEdited = { |
Description = "Has the document been modified since the last save?"; |
Name = modified; |
}; |
lastComponentOfFileName = {Description = "The document's name."; Name = name; }; |
}; |
Description = "A document."; |
Name = document; |
PluralName = documents; |
}; |
Script terminologies, like script suite files, are stored as text files of key-value pairs. As with a script suite file, a script terminology file consists of a series of nested dictionaries. Many of the subdictionaries (class, command, argument, and so on) should have counterparts in the script suite file.
The following tables describe the optional and required keys for a script terminology file.
Key | Value type or reference | Description |
|---|---|---|
“ | Human-readable name of suite (required); the name can be placed anywhere in the definition, as long as it is a first-level element | |
“ | Human-readable description of suite (optional; but highly recommended) | |
“ | Class list terminology dictionary (Table B-15) | Required only if there is a corresponding definition in the script suite file |
“ | Command list terminology dictionary (Table B-19) | Required only if there is a corresponding definition in the script suite file |
“ | Class synonym list terminology dictionary (Table B-23) | Required only if there is a corresponding definition in the script suite file |
“ | Enumeration terminology dictionary (Table B-25 | Required only if there is a corresponding definition in the script suite file |
Key | Reference | Description |
|---|---|---|
“className” | Class terminology dictionary (Table B-16) | One per each scriptable class. Must be the name of an Objective-C class. |
Key | Value type or reference | Description |
|---|---|---|
“ | Human-readable name of class (required) | |
“ | Human-readable description of class (optional; but highly recommended) | |
“ | Human-readable name for plural form of class (required) | |
“ | Attribute list terminology dictionary (Table B-17) | Attributes of the class (required only if there is a corresponding definition in the script suite file) |
Key | Reference | Description |
|---|---|---|
“attributeName” | Attribute terminology dictionary (Table B-18) | Description of attribute of the class |
Key | Reference | Description |
|---|---|---|
“commandName” | Command terminology dictionary (Table B-20) | One per each supported script command. |
Key | Reference | Description |
|---|---|---|
“argumentName” | Argument terminology dictionary (Table B-22) | Descriptions of command arguments. |
Key | Reference | Description |
|---|---|---|
“ | Class synonym terminology dictionary (Table B-24) | Descriptions of constant synonyms for class |
Key | Value type or reference | Description |
|---|---|---|
“ | Human-readable name of class (required) | |
“ | Human-readable description of class (optional) | |
“ | Human-readable name of plural form of class (required) |
Key | Reference | Description |
|---|---|---|
“enumerationName” | Enumerators list terminology dictionary (Table B-26) | One per enumeration (required). |
Key | Value type or reference | Description |
|---|---|---|
“enumeratorName” | Enumerator terminology dictionary (Table B-27) | One per enumerator (required). |
Key | Value type or reference | Description |
|---|---|---|
“ | Human-readable description of enumerator (optional) | |
“ |
Last updated: 2008-03-11