AppleScript Studio

AppleScript Studio is a set of software libraries that marries AppleScript with the Xcode and Interface Builder development tools (described in Chapter 15), and allows you to build Cocoa applications with full Aqua interfaces that use AppleScript source code.

If you have installed the Xcode Tools (see Chapter 15), Apple’s documentation for AppleScript Studio can be found in /Developer/Documentation/AppleScript/AppleScriptStudioX/index.html. However, if you already know AppleScript and understand how to program Cocoa or Carbon applications with Xcode and Interface Builder, there isn’t a whole lot more to learn. The following describes the basic differences between AppleScript Studio programming and ordinary Cocoa programming:

AppleScript source

Instead of Objective-C object classes, AppleScript Studio applications have AppleScripts make up their source code. However, like any other Cocoa application’s sources, these script files aren’t programs unto themselves; they instead define methods (verbs, through AppleScript’s on verbname syntax), some of which must bear the responsibility for UI event handlers. As with any Aqua application, a typical AppleScript Studio application spends most of its time in an idle loop, running its methods only when some user-directed event occurs.

Scripts in the source can use AppleScript’s script scriptname syntax to define subscripts that play the same role as object classes in other Cocoa applications.

Note that there’s still a main.m ...

Get Mac OS X Panther in a Nutshell, 2nd Edition 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.