|
Application
|
|
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. The applet’s script can be edited in Script Debugger by opening it with File > Open or by dropping the applet onto Script Debugger’s Dock or Finder icon. 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.
Script Debugger can save applications in two formats. You can choose a format either from the File > Script Format hierarchical menu or from the Save dialog.
- Application (Carbon). This format is compatible with Mac OS X and with late versions of earlier systems that use CarbonLib.
- Application (Bundle). This format was introduced in Panther (Mac OS X 10.3) and is not backwards compatible to earlier systems. It has the advantage that you can store ancillary files inside the bundle.
There also used to be a “Classic applet” format — an applet compatible with systems and AppleScript versions before Mac OS X, which cannot be run as Mac OS X-native. Mac OS X 10.5 (Leopard) has abandoned Classic, so such an applet cannot run at all. Script Debugger 4.5 will not save in this format. It can open a Classic applet, but when you try to save you will be compelled to choose another format. If you need to save a Classic applet, use an earlier version of Script Debugger.
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. 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.
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.