O'Reilly logo

AppleScript in a Nutshell by Bruce W. Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Script Saving Options

You have four different options for saving a file in Script Editor; however, Mac OS X does not support the stationery option of OS 9. These options are available from the File Save or File Save As menu choices.

Tip

A droplet is by definition saved as an applet, but AppleScript gives it a different icon due to the enclosure of its code in an on open handler.

Figure 2-6 shows the icons for AppleScript file types. Mac OS X supports all of these icon types except the stationery one.

Icons for AppleScript file types
Figure 2-6. Icons for AppleScript file types

Script text file

If a script cannot compile without errors, or you just want to save it as plain text, then use the script text saving option. The text option saves the file as file type 'TEXT' and creator type 'ToyS'. In OS X, Script Editor tries to compile a script first when you save it, then displays a dialog window if the script cannot be compiled without error, giving the user the option of saving the script as a text file. If you are not finished with the script and therefore do not yet want to try compiling the source code, then you can skip the compilation stage by holding down the Shift key and choosing Script Editor’s File Save menu item. The file will only be saved as a text file.

Compiled script file

Script Editor will try to compile the source code before saving it. After a script is saved as a compiled script, double-clicking ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required