Books Business Design Games Hardware Internet Utilities Text Other

Book Review: AppleScript In A Nutshell

 

Friday, July 27, 2001

By Applelinks Contributing Editor Charles W. Moore

AppleScript is one of the very cool things about the Macintosh for which there is no real equivalent in the Wintel orbit, but way too few Mac users really take advantage of what it has to offer.

How many times a day do you perform the same dull and time-consuming tasks on your Mac?; opening and closing programs; typing e-mail addresses; checking your e-mail. AppleScript can do all these things and much more with a keystroke or mouse click shortcut.

"Not enough Macintosh users are ever aware that their computer comes installed with this great tool," says Bruce W. Perry, author of O'Reilly's New AppleScript in a Nutshell addition to their "in a nutshell" series of computer books. "They tend to become distracted by the inner workings (or failings) of their favorite programs, to the point where they become less productive. As a powerful automation tool, AppleScript can thus free users from the bondage of machine-like behavior."

With his new book, Perry hopes to encourage and instruct more Mac users in making more expansive and better use of AppleScript.

With AppleScript you can, without programming training and skills, write or record small programs or "applets" to automate tedious and repetitive operations performed by the Mac operating system or a wide variety of AppleScript-savvy Mac applications.

I was really turned on to AppleScript by Tom Bender's Tex Edit Plus text editor, which has the slickest AppleScript support of any application I've encountered. I've used a combination of AppleScripts that I recorded myself and others that I downloaded from Doug Adams' cool script archive Web site to customize Tex Edit Plus into a word cruncher and HTML editor that suits my specific needs to a "T." You can visit Doug Adams’ site, which is devoted specifically to scripting Tex-Edit and contains an AppleScript guide for beginners, here: http://www.malcolmadams.com/te/

AppleScript in a Nutshell is written for anyone who is interested in becoming more knowledgeable about AppleScript, be they novices, power users, or graphics professionals, as the first complete AppleScript reference manual. "Readers will be able to use it as a reference next to their Macs as they write new scripts," says Perry. "They will specifically learn how to program various system elements to which I have devoted separate chapters such as speech technology, Sherlock, network setup scripting, and folder actions."

AppleScript in a Nutshell covers the latest updates and improvements in AppleScript version 1.4 and beyond, running on Mac OS 9.x and Mac OS X. Bruce Perry says the purpose of the book is threefold:

1. Describe AppleScript and its tools and provide a core language reference.

2. Provide detailed descriptions, examples, and reference information on how to script various functions and features of the Mac OS.

3. Give AppleScripters general insight on how to approach scripting several popular third party Mac applications such as Photoshop, FileMaker Pro, Quarkxpress, and others.

The book is organized in six parts with 35 chapters and two appendices.

Part I, "AppleScript: An Introduction," includes the first two chapters and covers the basics of AppleScript, and various ways it can be used to make the use of Mac computers more efficient and pleasurable, noting that with the release of Mac OS 9, Apple made most of the OS script double and controllable by AppleScript. AppleScript is not fully integrated on OS X yet, but it is coming.

As for other software, Perry notes that "If an application is attachable and recordable (or both) [such as Tex Edit Plus], it is considered a near paragon of scriptability. Attachable means that you can create a script and attach it to a program, so that the script is added to the program's internal menu. A few applications allow themselves to be recorded by Script Editor [part of the Mac OS AppleScript package], which is a great way to get started scripting them."

Perry goes on to describe and discuss Apple Events, which is the way AppleScript and scriptable programs communicate with each other in the Mac OS, in considerable detail in Chapter1. Chapter 2 addresses the use of Script Editor, and describes using AppleScript with Mac OS 9.x and 0S X respectively.

Part II, incorporating chapters 3 through 9, is the section to look in for more information on specific AppleScript language functions, with plenty of syntax examples and text descriptions. The chapters respectively cover Data Types; Operations; Reference Terms; Variables and Constants; Flow-Control Statements; Subroutines; and Script Objects and Libraries. This is not a section you're likely to read through from start to finish, but rather a comprehensive reference.

The book has handy Chapter identification marks staggered at the page edges, which makes it easy to quickly find the beginning of a chapter or section.

Part III includes chapters 10 through 18, and covers scripting Mac OS 9 applications at the system level, such as Apple System Profiler, Keychain scripting, the Finder, Network Setup scripting, and Sherlock 2.

Part IV, chapters 19 through 31, carries on with scripting of the Mac's Control Panels and Extensions, including new scriptable technologies such as Apple Data Detectors, Folder Actions, and Speech-related Extensions which allow you to integrate speech into your scripts such as the "listen for" and "say" AppleScript commands.

Part V, "Scripting the Mac OS X System," notes that AppleScript faces formidable "competition from the programming tools that come with (and can be installed on) Mac 0S X, such as shell scripting tools, Perl, and Java." However, AppleScript still has plenty to offer MAC 0S X users, and this section tells how to script the OS X Desktop, the Mail application, the Terminal App, and Text Edit.

Part VI includes Appendix A, -- Standard Scripting Additions, and Appendix B, AppleScript Resources. There is also an extensive index.

AppleScript in a Nutshell is an Apple Developer Connection "recommended title," and it delivers on its promise of being the definitive AppleScript desktop quick reference.

My main criticism of the book is more its style than its substance. Bruce Perry obviously knows his stuff, but he is also definitely a no-nonsense, "just the facts," sort of writer, which makes AppleScript in a Nutshell a less than entertaining, albeit very informative, tome. Perhaps I've been spoiled by David Pogue's ability to combine information with conversational readability in O'Reilly's companion "The Missing Manual" series, but it would have been nice if Mr. Perry had been able to make this book read a bit less like a textbook or a programmer's manual.

However, if you want to learn how to use AppleScript, on your Mac, this is the best resource I've encountered to date. Consequently, I'm going to give AppleScript in a Nutshell a double Applelinks rating -- one for information value and another for readability.

Applelinks Rating (Information Value)

Applelinks Rating (Readability)

AppleScript in a Nutshell
By Bruce W. Perry
June 2001
1-56592-841-5, Order Number: 8415
526 pages, $29.95
http://www.oreilly.com/catalog/aplscptian/

Sample Chapter:
Chapter 7
Flow-Control Statements
http://www.oreilly.com/catalog/aplscptian/chapter/ch07.html

***

Appendix: AppleScript in a Nutshell Table of Contents


Charles W. Moore

Shop for AppleScript Books

Email This Article - Comment On This Article

.

Reader Specials

Server Racks Online:
Apple Xserve CompatibleServer Racks and Universal Network Racks
42U KVM Switch Solutions:
High-End Mac and Multi-Platform KVM Matrix switching solutions!
Digital Camera Online:
Great prices on Digital Cameras and accessories!
KVM Switches Online:
Great prices on Mac KVM Switches from the leading manufacturers!
LCD Monitors Online:
Great prices on LCD Monitors from the leading manufacturers!
LCD Projectors Online:
Shop online for LCD Projectors from the leading manufacturers!
USB 2.0 Online:
Great prices on USB 2.0 products from the leading manufacturers

Serious Business Software:
Accounting, Sales, Inventory, CRM, Shipping, Payroll & more!

KVM Switch solutions for MACs:
DAXTEN is a KVM switch, KVM extender and monitor splitter specialist for PC, SUN and MAC applications from name brand manufacturers - offices worldwide.

The "Think Different Store: The iPod Accessories Store - iPod cases, iPod mini, iPod photo, speakers, itrip, inMotion, Soundstage and all other iPod accessories

Earn Cash with the ThinkDifferent Store Affiliates Program

Need A Web Site?
Applelinks Web Hosting Starting at 19.95 a Month

iTunes_RGB_9mm

.

iTunes_RGB_9mm

Cool Mac Gear


iPod 1G-2G
iPod 3G
iPod 4G
iPod Mini
PowerBook-iBook
Keyboard Skins
Garageband