I’m trying to save a .applescript file into complied .scpt file and then load it. Please see the following Handler:
______________________________________________________________________
Hey Dave,
If you look at store script it requires a script object as its direct object.
A text script is NOT a script object.
I don't often fool with script objects, so I'm a bit fuzzy on the subtleties of this.
The only way I know of to compile a text script is with the shell `osacompile`.
osacompile -o <object-file> <source-file> (see the man page)
From there you can load it.
There may be a vanilla AppleScript method I don't know of, and I suspect there is a method using ASObjC (but that'll have to wait for Shane).
|