Previous Page
Next Page

Preface

If you use a Macintosh, there's something amazing lurking under the hood of your computer, and something even more amazing on the surface. Under the hood, there's a system-level mechanism for applications to communicate with one another, order each other about, get information from each other, and generally collaborate to avail themselves of each other's strengths and abilities. On the surface, there's AppleScript, which puts the power of this mechanism into the hands of ordinary users, letting them program the computer for themselves by writing and executing code in the AppleScript language, as a way of automating the behavior of applications, reducing many steps to one, throwing the burden of repetition and calculation onto the computer, and combining the powers of multiple applications into a seamless united workflow. AppleScript can be used to construct a simple brief automation or a massive complex chain of events. It's a brilliant labor-saving deviceand saving labor is what computers are all about.

AppleScript is one of the greatest innovations of Mac OS, one of its most notable distinguishing featuresand one of its most practical. Users from lone amateurs to mighty corporations have come to depend on it. Yet AppleScript was long treated by Apple itself as something of an unwanted, troublesome stepchild, and has even (according to apocryphal legend) at times come perilously near to being tossed onto the scrapheap. With the rise of Mac OS X, however, AppleScript has prospered, enjoying a kind of Golden Age, being embraced and acknowledged as one of Apple's star technologies. It is noted on Apple's own web pages as a major element of Mac OS X (for example, see http://www.apple.com/macosx/overview/). The Script Editor has been rewritten as a Cocoa application. Scripts may be run from a systemwide menu. More and more of Apple's own new applications are scriptable. Integration with Unix scripting has been provided. Automator (new in Tiger) lets users effectively assemble, customize, and run scripts without having to deal with any code. Even applications that are not technically scriptable can be targeted with AppleScript. Users can actually write a genuine application with a full-fledged Aqua user interface, using AppleScript as their programming language, thanks to the astounding AppleScript Studio. And it all comes for free as part of Mac OS X.

In this context, with interest in AppleScript waxing anew, the need for a complete explanatory manual and reference is greater than ever. In that spirit, this book has been offered. It is hoped that it will prove helpful to AppleScript's beginning and veteran users alike. Neither prior knowledge of AppleScript nor any previous programming experience is assumed, so that the complete beginner can use this book to learn AppleScript from the ground up; at the same time, the book aims at a degree of technical depth and completeness that will satisfy the needs of those who wish to consult it to check some point of syntax, or to gain a firmer understanding of such advanced arcana as how the scoping rules operate, how terminology is resolved, or what an Apple event really is.


Previous Page
Next Page