Using a dictionary

    To know which commands and objects you can use to control a program, you look at the program's dictionary.

    To open a dictionary:
    1 While in the Script Editor, open the File menu and choose Open Dictionary.
    2 Locate the program in the dialog box and open it.
    3 To see details about a term or a suite, click to select it.

    Open a dictionary in the Script Editor for me.

    If you cannot open a dictionary for a program:
    The program is not scriptable and does not have a dictionary.

Reading a dictionary

    In a dictionary, terms are organized into groups of related terms called "suites." Commands are in plain text. Objects are in italics.

    To see the definition of a term or suite of terms:
    Click to select it.
    The definition appears in the right side of the window.

    The definition includes a brief description of the term (the underlined text) and its syntax. The syntax is the way you must write the term in a script. The syntax may include various parts. Each part has a description, shown as a comment, following the syntax.

    Command definitions:
    In the example above, the Quit command has a simple syntax. The syntax for most commands includes other information required to use the command. For example, the Count command has this syntax:

    count reference -- the object whose elements are to be counted
    each type class -- the class of the elements to be counted
    Result: integer -- the number of elements

    Bold words are the terms you use in a statement; you must write them exactly as they appear in the dictionary. Plain text words are information you provide. For example, "reference" means the name of the object you want to count. The text to the right of the dashes is a description.

    Terms that appear in brackets are optional:

    computer type class -- the attribute to test
    [has integer] -- test specific bits of response
    [Result: integer] -- the result of the query

    Object descriptions:
    Object definitions look similar to this:

    In this example, the object has a plural form so you can refer to more than one application in a script. Some objects do not have a plural form.

    Objects may include a list of elements, which are objects contained within the object. The element name appears in bold, while the plain text following the element describes how to refer to the element in a script.

    Objects have properties, or characteristics, which you can use in your script. The syntax of properties is shown in bold text. The plain text following a property describes the type of value the property contains. This may be a string, a number, or a boolean (true or false) value, or a reference. In some cases, the property may have a fixed value, called a "constant," or a list of constants.

    Some properties includes "[r/o]" after the syntax. This means the property is "read only." In a script, you can get a read-only property, but you cannot set it.

 


Table of contents