Language Guide

CHAPTER 5
Objects and References
140 Using the Filter Reference Form
The following example contains three references. The first two are Index
references that specify the front document and the first word. The third
is a Relative reference that specifies the insertion point before the tenth
paragraph. The command moves the first word to the insertion point
before the tenth paragraph.
tell front document of application "Scriptable Text Editor"
move word 1 to before paragraph 10
end tell
NOTES
You can specify only a single object with the Relative form. You can use the
form to specify an object that is either before or after the base object.
If it is possible for the specified object to contain the base object (as in the
expression paragraph before word 99), the reference does not specify
the container but instead specifies the object immediately before or after the
container of the base object. For example, the expression paragraph before
word 99 specifies the paragraph immediately before the paragraph containing
the ninety-ninth word.
All applications allow you to specify a base object belonging to the same
class as the desired object (such as window in back of window "Big").
Not all allow you to specify a base of a different object class (such as word
before figure 1). The possible base classes for a particular class are up
to each application.
Using the Filter Reference Form 5
When specifying one or more objects contained in an application object, you
can use the Filter reference form to include an optional filter. A filter restricts
the objects you specify to those that match one or more conditions.