Language Guide

CHAPTER 5
Objects and References
128 Reference Forms
EXAMPLES
The following example assigns a string to the variable myString, and then
uses the Every Element reference form to specify every word contained in
the string.
set myString to "That's all, folks"
every word of myString
The value of the reference every word of myString is a list with
three items:
{"That's", "all", "folks"}
The following reference specifies the same list:
words of myString
The following references specify a list of all the words in the first paragraph of
a document.
tell front document of application "Scriptable Text Editor"
every word of paragraph 1
words of paragraph 1
end tell
NOTES
If you specify an Every Element reference as the container for a property or
object, the result is a list containing the specified property or object for each
object of the container. The number of items in the list is the same as the
number of objects in the container. For example, the value of the reference
length of every word
is a list such as
{ 2, 3, 6 }
The first item in the list is the length of the first word, the second item is the
length of the second word, and so on.