AppleScript’s Studly Studio
Users of Mac OS X, when Apple releases version 10.2, will find a little something extra in their holiday stocking – AppleScript Studio. Since its announcement in September, though it immediately won a Macworld award, AppleScript Studio has been mostly just a name; beta-testers weren’t allowed to tell what it was. But last week AppleScript Studio’s documentation was made public, and AppleScript Studio itself was released in the free December Developer Tools, so the cat’s out of the bag. And what a cat! AppleScript Studio isn’t a mere scripting tool; it isn’t just AppleScript with some interface widgets wrapped around it. AppleScript Studio is Cocoa.
Cocoa is an application framework – a set of interface widgets, and the knowledge of how to manipulate them, along with windows and documents and everything else, to form a standard working application. This framework is built right into Mac OS X, which is why Cocoa applications are relatively compact, with a fairly uniform look and feel: the system itself contains much of their code, and they draw upon the same set of built-in interface widgets and behaviors. For writing Cocoa applications, Apple provides free tools called Interface Builder and Project Builder, in which you respectively draw the interface and write the code. Up to now, users have had a choice of two code languages, Objective-C and Java; AppleScript Studio means there is now a third choice – AppleScript.
AppleScript is an English-like language originally designed for encoding Apple events to drive other applications. AppleScript Studio is a system-level addition to OS X that gives this language the hooks needed to talk to Cocoa’s interface widgets and built-in functions. The learning curve isn’t trivial – Project Builder and Interface Builder aren’t simple to use – but the implication is that users who already know AppleScript, or who are willing to learn it instead of a more daunting full-fledged programming language, can leverage their knowledge to write Cocoa applications. I must stress that from the outside, an application written with AppleScript Studio is indistinguishable from any other Cocoa application. Just as on the Internet no one can tell you’re a dog, with AppleScript Studio no one can tell that you didn’t know Objective-C.
It was evident in Mac OS X 10.1, from such evidence as the new Scripts menu, that after years of almost ignoring it, Apple had finally understood the importance of AppleScript, and was promoting it to first-class status. With AppleScript Studio, that promotion is complete. Look for it when Mac OS X 10.2 ships, and you too can unleash your inner Cocoa programmer urges.