Language Guide
CHAPTER 2
Overview of AppleScript
18 Dictionaries
specified incompletely in the command. In this case, the statement containing
the Print statement does not contain enough information to uniquely identify
the window object, so AppleScript uses the application name listed in the Tell
statement to determine which object receives the Print command.
In AppleScript, you use references to identify objects. A reference is a
compound name, similar to a pathname or address, that specifies an object.
For example, the following phrase is a reference:
front window of application "Scriptable Text Editor"
This phrase specifies a window object that belongs to a specific application.
(The application itself is also an object.) AppleScript has different types of
references that allow you to specify objects in many different ways. You’ll learn
more about references in Chapter 5, “Objects and References.”
Objects can contain other objects, called elements. In the previous example, the
front window is an element of the Scriptable Text Editor application object.
Similarly, in the next example, a word element is contained in a specific
paragraph element, which is contained in a specific document.
word 1 of paragraph 3 of document "Try This"
Every object belongs to an object class, which is simply a name for objects with
similar characteristics. Among the characteristics that are the same for the
objects in a class are the commands that can act on the objects and the elements
they can contain. An example of an object class is the Document object class in
the Scriptable Text Editor. Every document created by the Script Editor belongs
to the Document object class. The Script Editor’s definition of the document
object class determines which classes of elements, such as paragraphs and
words, a document object can contain. The definition also determines which
commands, such as the Close command, a document object can respond to.
Dictionaries 2
To examine a definition of an object class, a command, or some other word
supported by an application, you can open that application’s dictionary from
the Script Editor. A dictionary is a set of definitions for words that are
understood by a particular application. Unlike other scripting languages,