Scriptable Text Editor Commands
This section defines the commands that are understood by the Scriptable Text Editor and its objects.The Scriptable Text Editor supports most of the standard application commands listed in Chapter 4, "Commands." As is true for most scriptable applications,
the Scriptable Text Editor's definitions for some of these commands differ slightly from the standard definitions. Table B-1 summarizes the differences between the defined behavior of the standard commands and the Scriptable Text Editor behavior.
Variations from standard behavior in Scriptable Text Editor versions of standard application commands Standard
application commandScriptable Text Editor version Close Identical to the standard version defined on page 86. Copy Behaves like the standard version defined on page 88, except that the direct parameter must be a single object. The Scriptable Text Editor cannot copy a range of objects. Count Identical to the standard version defined on page 91. Data Size Behaves like the standard version defined on page 96, except that the Scriptable Text Editor returns the size of text objects as a data class that includes writing code information. The writing code information adds 4 bytes to the data size. Delete Identical to the standard version defined on page 98. Duplicate Behaves like the standard version defined on page 98, except that the direct parameter must be a single object. The Scriptable Text Editor cannot duplicate a range of objects. Exists Identical to the standard version defined on page 99. Get Identical to the standard version defined on page 100. Make Behaves like the standard version defined on page 104, with some exceptions. The default location for new text objects is the current selection; the default location for new document and window objects is in front of other Scriptable Text Editor windows. When you create text objects with the Make command, the Scriptable Text Editor automatically adds the appropriate delimiters before or after the new text objects, depending on the script code for the new text, the script code for the surrounding text, and, in the case of text items, the value of the Text Item Delimiters property. Do not include delimiters in the
with data
parameter.Move Behaves like the standard version defined on page 106, except that the direct parameter must be a single object. The Scriptable Text Editor cannot move a range of objects. Open Behaves like the standard version defined on page 107, except that the Scriptable Text Editor can only open text files or its own files.
If you use the Open command to open a file of type"TEXT"
, the Scriptable Text Editor automatically converts the file to a Scriptable Text Editor file and appends ".s
" to the end of the filename.Identical to the standard version defined on page 108. Quit Identical to the standard version defined on page 109. Run Identical to the standard version defined on page 110. Save Behaves like the standard version defined on page 112, except that it has an optional parameter that allows you to save Scriptable Text Editor files as text files. The direct parameter of the Save command must be a single object. The Scriptable Text Editor cannot save a range of objects.
Set Identical to the standard version defined on page 113. Table B-2 summarizes the commands other than the standard application commands that are supported by the Scriptable Text Editor.
The sections that follow describe both the commands listed in Table B-1 that differ from the standard versions and the commands listed in Table B-2.