Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix B - Scriptable Text Editor Dictionary / Scriptable Text Editor Object Class Definitions


The Application object class defines the characteristics of the Scriptable Text Editor application.

Information stored in the Clipboard. The Clipboard is an area in the computer's memory that functions as a holding place for information that is cut or copied. The Scriptable Text Editor uses the Clipboard that is shared by all applications.
Class: List of data objects (see "Notes" later in this section)
Modifiable? Yes
A Boolean parameter that indicates if the application is the active application. If the value is true, the Scriptable Text Editor is the active application. If the value is false, the Scriptable Text Editor is not the active application.
Class: Boolean
Modifiable? No
The name of the application.
Class: String
Modifiable? No
The current selection. The object or objects in the selection are the ones that would be cut by a Cut command or copied by a Copy command. If no objects are selected, the value of this property is a reference to an insertion point object.
Class: Reference
Modifiable? Yes
Text Item Delimiters
The characters that are used to separate text item objects. By default, the value of this property is a single comma, {","} (see "Notes").
Class: List of text objects
Modifiable? Yes
The version of the Scriptable Text Editor.
Class: String
Modifiable? No
Scriptable Text Editor documents that are currently open (see "Notes").
Scriptable Text Editor windows that are currently open (see "Notes").
Open, Print, Quit, Run


tell application "Scriptable Text Editor" to quit
cut the selection of application "Scriptable Text Editor"
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 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996