Language Guide

CHAPTER 5
Objects and References
Reference Forms 125
Similarly, the following Tell statement tells the Scriptable Text Editor to delete
the third word of the first paragraph of the front document.
tell paragraph 1 of front document of application
"Scriptable Text Editor"
delete word 3
end tell
Tell statements can contain other Tell statements, called nested Tell statements.
When AppleScript encounters a partial reference in a nested Tell statement, it
tries to complete the reference starting with the innermost Tell statement. If that
does not provide enough information, AppleScript uses the direct object of the
next Tell statement, and so on. For example, the following Tell statement is
equivalent to the previous example.
tell front document of application "Scriptable Text Editor"
tell paragraph 1
tell word 3
delete
end tell
end tell
end tell
Reference Forms 5
A reference form is the syntax, or rule, for writing a phrase that identifies an
object or group of objects. For example, the Index reference form allows you to
identify an object by its number, as in
word 5 of paragraph 10
AppleScript includes other reference forms for identifying objects in
applications. Table 5-1 summarizes the reference forms you can use to identify
objects. Each section that follows includes a brief explanation of the reference
form, a syntax summary, and examples of how to use the reference form to
specify application objects. The Filter reference form is described in more detail
in “Using the Filter Reference Form,” which begins on page 140.