Special Properties of Scriptable Text Editor Text Objects
Like most scriptable applications, the Scriptable Text Editor supports standard groups, or suites, of AppleScript objects and commands. Different applications of the same type have many of the same objects and commands in their dictionaries. For example, most text-processing applications have paragraph objects, word objects, character objects, text item objects, and objects of class text. For the most part, these objects have the same properties in different applications.Sometimes scriptable applications add properties to standard objects that are not included in the standard suites. In the Scriptable Text Editor, each of the text object classes--paragraph, word, character, text item, and text--includes the following special properties:
- The Length property specifies the number of characters in the object.
- The Offset property specifies the offset, in characters, from the beginning of a Scriptable Text Editor document to the first character of the text object. For example, if a document begins with the words "We the people", the offset of the word "We" is 1 and the offset of the word "people" is 8.