Chapter 24. Writing Applications

Macintosh standalone applications are typically written in languages such as C, C++, Objective-C, or REALbasic. But you can write an application with AppleScript, and this chapter talks about the ways you can do it. You can write an applet or a droplet, essentially converting a script directly into an application; this application will be more or less faceless, but it’s a true standalone application, it can accept drag-and-drop of files and folders onto its icon, and it’s scriptable. Or you can wrap your script in a full-fledged Cocoa interface with AppleScript Studio.

This chapter also talks about writing CGIs and how AppleScript may be used to supplement a web server. It talks about digital hub scripting. And it talks about folder actions; a folder action is not really an application, but it is like an application in that it runs independently and spontaneously, and because it responds to certain events.

Applets

An applet is a compiled script wrapped up in a simple standalone application shell (see Section 4.6). To make a script into an applet, save it from the Script Editor as an application instead of as a compiled script. You elect this choice in the Save As dialog. The result is a standalone application. If you open the application from the Finder (by double-clicking it, for example), the script runs.

Alternatively, you can now save a script as an application bundle. From the outside, the result looks and works like an applet, exactly as described ...

Get AppleScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.