Language Guide

APPENDIX B
Scriptable Text Editor Dictionary
320 Scriptable Text Editor Object Class Denitions
NOTES
The AppleScript English language dialect supports the abbreviation app for
referring to objects of class application. For example, the following statements
are equivalent:
cut the selection of application "Scriptable Text Editor"
cut the selection of app "Scriptable Text Editor"
The window and document element classes can be used interchangeably. This
is because each open document has a window, whose elements and properties
are always the same as those of its document. For example, if the first open
document is named Giant, the first window is also named Giant. A Scriptable
Text Editor document and its window contain the same text elements, so
references to text elements in a document and its window can be used
interchangeably. For example, word 1 of document "Giant" and word
1 of window "Giant" refer to the same word.
Text item objects are series of contiguous characters that are separated from
each other by special characters called delimiters. The Text Item Delimiters
property of the Scriptable Text Editor application consists of a list of characters
that can be used to separate text item objects. At startup the default value of the
Scriptable Text Editor’s Text Item Delimiters property is a single-item list that
contains a comma: {","}. You can set this delimiter to a different value or add
additional delimiters, but the new values are lost when the user quits the
application. You may find it convenient to alter the Text Item Delimiters
property temporarily if you are dealing with multilingual text or text formatted
with other delimiters.
The Clipboard property is a list of objects of class Data, but you can use the
As operator to get the Clipboard as a string, reference, or styled text. The
Scriptable Text Editor coerces the data to the requested type, if possible.
tell application "Scriptable Text Editor"
cut word 1 of front document
get clipboard as string
end tell
--result: the first word of the document as a string