Scripting Additions Guide
Table Of Contents
CHAPTER 2
Scripting Addition Commands
Command Definitions 39
EXAMPLES
set x to new file
open for access x
NOTES
If the user chooses the Cancel button, New File returns error –128. If you
want your script to continue after the user clicks Cancel, you must include
an error handler. For information about Tell statements and error handlers,
see Chapter 8, “Handlers,” of the AppleScript Language Guide.
ERRORS
Offset 2
The Offset command returns the offset of a string within a string. For example,
the offset of "freedom now" contained in "Yes, freedom now" is 6,
because the contained string begins with the sixth character of the container.
The offset of "Yes" in the string "Yes, freedom now" is 1, because it begins
with the first character of the container string. The Offset command is
case-sensitive.
Offset is one of several commands provided by the String Commands
scripting addition.
SYNTAX
offset of stringToFind in stringToSearch
Error
number Error message
–108 Out of memory.
–128 User canceled.