Scripting Additions Guide

CHAPTER 2
Scripting Addition Commands
Command Definitions 65
This example stores the script object DemoStore in a file called Store My RGB:
store script DemoStore in file ¬
"My HD:Some Folder:Store My RGB" replacing yes
The replacing yes parameter indicates that Store Script should overwrite
the existing file.
Later statements in the same script like the following load the stored script
object DemoStore, change one of its properties, and store it to disk again:
set objRef to load script ¬
file "My HD:Some Folder:Store My RGB"
set objRef's Red to 250
store script objRef ¬
in file "My HD:Some Folder:Store My RGB"
In this case the replacing parameter is omitted, so Store Script displays a
dialog box asking the user whether to overwrite the file, rename it, or cancel
the operation.
NOTES
To specify the name (nameString) of a file, use a string of the form "Disk:Folder1:
Folder2:...:Filename" as described in Chapter 5, “Objects and References,”
of the AppleScript Language Guide. If you specify only the name of the file
(Filename) instead of its entire pathname, AppleScript attempts to find the file in
the current directory.
ERRORS
Error
number Error message
–108 Out of memory.
–128 User canceled.
–192 Bad name for file.
–1700 Can't make some data into the expected type.
–1701 Some parameter is missing for <commandName>.