Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix B - Scriptable Text Editor Dictionary / About Text Objects

Elements of Text Objects

Each of the text object classes can contain any of the other text object classes as elements. For example, a word can also be a paragraph. A word object can contain character, word, and text item elements.

Classes of text objects are distinguished from each other by the way their boundaries, or delimiters, are defined. Because of this, the same text can be viewed as a collection of character elements, word elements, paragraph elements, or text item elements.

In addition to paragraph, word, character, and text item elements, all text objects can contain elements that belong to the class Text. An object belonging to class text is a series of contiguous characters. In any text object, the elements of class text are all of the possible series of contiguous characters contained within the object. The most common way to use an element of class Text is to specify the contiguous characters in a range of text objects.

For example, the following reference specifies all the characters, including spaces, from the beginning of the fifth word to the end of the twenty-fifth word.

text from word 5 to word 25
In contrast, the following reference specifies a list of words, with no information about spaces or punctuation between words.

word 5 thru 25

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996