A compiled script can be saved as an application, traditionally known as an applet. An applet is a stand-alone application. When opened in the Finder, the script runs.
An applet’s script can be edited in Script Debugger by opening it in any of the usual ways.
You can save a script as an applet and leave the script open in Script Debugger. This allows you to test the script from the Finder and then easily edit it in Script Debugger.
Script Debugger has some further features for helping you test a script that is destined to be saved as an applet. You can test individual handlers in the applet, and you can debug the applet while it is running.
To save a script as an application (if it isn’t an application already):
Choose File > Save As and select Application from the Format pop-up menu.
An applet is always saved as a bundle; this has the advantage that you can store ancillary files inside the bundle.
Besides the format, you can also set further options for the behavior of the resulting application. To do so, use the checkboxes in the Save dialog, or choose from the hierarchical File > Application Options menu. (You can also add Stay Open and Show Startup buttons to the script window’s toolbar. They change their names and icons to indicate whether the setting is on or off.)
Show Startup Screen. The script’s description is used as a “splash screen” when the applet starts up. This splash screen also contains buttons allowing the user to quit or run the applet.
Stay Open. The distinction being made here is as follows:
An applet that does not stay open runs its script when opened and then automatically quits.
An applet that does stay open does not automatically quit after running its script (the user can choose its Quit menu item to quit it later). This is useful if, for example, the applet runs a handler periodically at idle time.
32-Bit Only. This is identical to checking “Open in 32-bit mode” in the application’s Get Info dialog in the Finder. The application will open in 32-bit mode even in a 64-bit context. This option might rarely be useful for compatibility with 32-bit scripting additions.
Warning: An application saved in debug mode will not run normally (when launched, it will initiate an external debugging session in Script Debugger). Unless that’s what you intend, be sure to save the application in normal mode when you’re finished debugging it.