AppleScript in a Nutshell is the first complete reference to AppleScript, the popular programming language that gives both power users and sophisticated enterprise customers the important ability to automate repetitive tasks and customize applications. As the Macintosh continues to expand and solidify its base in the multimedia and publishing industries, AppleScript is the tool of choice on this platform for creating sophisticated time- and money-saving workflow applications (applets). These applets automate the processing and management of digital video, imaging, print, and web-based material. AppleScript is also gaining a foothold in scientific programming, as technical organizations adopt G4 CPU-based systems for advanced computing and scientific analysis. Finally, "power users" and script novices will find that AppleScript is a great everyday Mac programming tool, similar to Perl on Windows NT or Unix.In this well-organized and concise reference, AppleScript programmers will find:
* Detailed coverage of AppleScript Version 1.4 and beyond on Mac OS 9 and Mac OS X.
* Complete descriptions of AppleScript language features, such as data types, flow-control statements, functions, object-oriented features (script objects and libraries), and other syntactical elements.
* Descriptions and hundreds of code samples on programming the various "scriptable" system components, such as the Finder, File Sharing, File Exchange, Network scripting, Web scripting, Apple System Profiler, the ColorSync program, and the numerous powerful language extensions called "osax" or scripting additions.Most other AppleScript books are hopelessly out of date. AppleScript in a Nutshell covers the latest updates and improvements with practical, easy to understand tips, including:
* Using AppleScript as a tool for distributed computing, an exciting development that Apple Computer calls "program linking over IP." Programmers can now do distributed computing with Macs over TCP/IP networks, including controlling remote applications with AppleScript and calling AppleScript methods on code libraries that are located on other machines.
* Using the Sherlock find application to automate web and network searching.
* Insights on scripting new Apple technologies such as Apple Data Detectors, Folder Actions, Keychain Access, and Apple Verifier.AppleScript in a Nutshell is a high-end handbook at a low-end price--an essential desktop reference that puts the full power of this user-friendly programming language into every AppleScript user's hands.
Bruce W. Perry is an independent software developer and writer, and the author of O'Reilly's Java Servlet & JSP Cookbook and Ajax Hacks. Since 1996, he has developed web applications and databases for various nonprofits, design and marketing firms, as well as publishers. In his spare time, Perry is an active age-group triathlete and has cycled extensively in the Swiss Alps. He splits his time between Warren, Vermont and the Newburyport, Massachusetts area with his wife Stacy LeBaron, daughter Rachel, and son Scott.
Preface;
Organization of This Book;
Conventions Used in This Book;
How to Contact Us;
Acknowledgments;
Introduction to AppleScript;
Chapter 1: AppleScript: An Introduction;
1.1 How Is AppleScript Used?;
1.2 Apple Events;
1.3 Using Script Runner with OS X;
1.4 Using OSA Menu with OS 9;
1.5 Checking Your AppleScript Version;
1.6 Diving In;
Chapter 2: Using Script Editor with OS 9 and OS X;
2.1 Script Editor Controls/Commands;
2.2 Scripting the Script Editor;
AppleScript Language Reference;
Chapter 3: Data Types;
Chapter 4: Operators;
Chapter 5: Reference Forms;
Chapter 6: Variables and Constants;
6.1 Variables;
6.2 Constants and Predefined Variables;
Chapter 7: Flow-Control Statements;
Chapter 8: Subroutines;
8.1 Subroutines with Positional Parameters;
8.2 Subroutines with Labeled Parameters;
Chapter 9: Script Objects and Libraries;
Scripting Mac OS 9 Applications;
Chapter 10: Apple Guide and Help Viewer;
Chapter 11: Apple System Profiler;
Chapter 12: Keychain Scripting and Apple Verifier;
Chapter 13: Desktop Printer Manager;
Chapter 14: Mac OS 9 Finder Commands;
14.1 Example Finder Scripts;
Chapter 15: Mac OS 9 Finder Classes;
Chapter 16: Network Setup Scripting;
Chapter 17: Scripting Sherlock 2;
Chapter 18: URL Access Scripting;
Scripting Mac OS 9 Control Panels and Extensions;
Chapter 19: Appearance Control Panel;
Chapter 20: Apple Data Detectors Extension;
Chapter 21: Apple Menu Options Control Panel;
Chapter 22: Application Switcher Extension;
Chapter 23: ColorSync Extension;
Chapter 24: File Exchange Control Panel;
Chapter 25: File Sharing Control Panel;
Chapter 26: Folder Actions Extension;
Chapter 27: FontSync Control Panel and Extension;
Chapter 28: Location Manager Control Panel;
Chapter 29: Memory and Mouse Control Panels;
Chapter 30: Speech Listener and SpeakableItems Extension;
Chapter 31: Web Sharing Control Panel;
Scripting the Mac OS X System;
Chapter 32: Scripting the OS X Desktop;
32.1 Working with Files, Folders, Disks, and Windows in OS X;
Chapter 33: Scripting Mail;
33.1 Setting Up an Email Message;
33.2 Exploring the Mail Application Object;
33.3 Getting Information about an Email Account;
Chapter 34: Executing Scripts with the Terminal App;
Chapter 35: Scripting TextEdit;
Appendixes;
Standard Scripting Additions;
AppleScript Resources;
Apple Computer AppleScript URLs;
AppleScript FAQs, Mailing Lists, and Tutorials;
Macintosh Scripting Sites;
Commercial AppleScript Development Environments;
Freeware AppleScript Development Environments;
Colophon;