Language Guide
CHAPTER 5
Objects and References
Reference Forms 137
EXAMPLES
The following examples and results use the Scriptable Text Editor document
shown in Figure 5-2.
Figure 5-2 The Scriptable Text Editor document “simple”
In the following example, the phrase words from paragraph 1 to
paragraph 2 is a range reference that specifies the list of the words in
the first and second paragraphs.
tell document "simple" of application "Scriptable Text Editor"
get words from paragraph 1 to paragraph 2
end tell
--result: {"This", "is", "paragraph", "one", ¬
"This", "is", "paragraph", "two"}
In the following example, the phrase words of paragraphs 1 thru 2 is a
reference that consists of the reference words (a synonym for every word)
and the container paragraphs 1 thru 2 (a range reference).
tell document "simple" of application "Scriptable Text Editor"
get words of paragraphs 1 thru 2
end tell
--result: {{"This", "is", "paragraph", "one"}, ¬
{"This", "is", "paragraph", "two"}}