Are you taking advantage of this great Apple technology? This book is a thorough orientation and tutorial guide to AppleScripting for beginners to advanced users

" />



Charles Moore Reviews: AppleScript: The Definitive Guide, 2nd Edition

2601 AppleScript has long been one of the very cool things about the Macintosh for which there is no real equivalent in the Wintel world, and which happily migrated to OS X better than ever, 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 email addresses; checking your email. AppleScript can do all these things and much, much more with a keystroke or mouse click shortcut to trigger a simple, brief automation, or a massively complex sequence of events - sort of a programming "Swiss Army knife" for productivity enhancement.

AppleScript is now being acknowledged by Apple to be a major element of Mac OS X, and the Script Editor utility has been rewritten as a Cocoa application. Many of Apple's own applications for OS X are scriptable, as are many third-party programs. The Automator feature, introduced in OS X 10.4 Tiger allows users to assemble, customize, and write scripts without having to ever deal with actual code.

As a powerful automation tool, AppleScript can thus free users from the bondage of machine-like behavior, but relatively few Mac users really take advantage of this wonderful OS X feature. Indeed I expect that many Macintosh users aren't even aware that their computers come installed with this great tool, partly because Apple doesn't go out of its way to promote Applescript in the sketchy documentation that ships with Apple products these days.

"I had never seen the AppleScript language taught, explained, and documented in what I would regard as a clear, rigorous, and helpful way," says Matt Neuberg, author of O'Reilly's new "AppleScript: The Definitive Guide, 2nd Edition." So Matt has taken the bull by the horns himself, with this book that presents AppleScript as a programmer, a student, and a thinker would learn it respectively, with the objective of encouraging and instructing more Mac users in making more expansive and better use of AppleScript. This latest edition is completely revised and fully updated to cover Mac OS x 10.4 Tiger and AppleScript 1.10.

image


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 powerful 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: The Definitive Guide" is written for anyone who is interested in putting their Mac to work by becoming more knowledgeable about AppleScript, be they novices, power users, or graphics professionals. The book is a thorough, straightforward reference and installation guide in which Neuberg endeavors to explain everything Mac users need to know about AppleScript; what it is, why it exists, how it works, and how to make it perform better, smoother, and faster.

Neither prior knowledge of AppleScript nor any previous programming experience is the Salem, so a complete beginner can use this book to learn AppleScript from scratch, while the author has taken pains to incorporate a degree of technical depth and completeness that should satisfy the needs of more advanced users.

AppleScript is defined by Neuberg has "a system-level technology," and a "little language," not particularly useful or powerful on its own, but ready to talk to scriptable applications and to take advantage of their utility and power.

However, rather than being an amateur-grade programming language for dabblers, Neuberg contends that AppleScript is a "real programming language" - really interesting, fairly complicated, sometimes sophisticated, often opaque, and quirky. "As Socrates said of virtue, AppleScript isn't something we all somehow are born having; it must be learned, and therefore taught it must be taught," he says. This book is dedicated toward that end. Incidentally, Neuberg, a former editor at MacTech magazine, has a Ph.D. in Greek and Latin, and sometimes it shows.

The book is organized in three parts with 27 chapters and three appendices.

Part I of "AppleScript: The Definitive Guide," "AppleScript Overview," includes the first three chapters and covers the nature and purpose of AppleScript, the program's basic concepts and various ways it can be used to make the use of Mac computers more efficient and pleasurable.

Chapter 1, "Why To Use AppleScript," includes some motivational guidelines, and samples of AppleScript in action in real-life contexts. Neuberg endeavors to answer the applicable existential questions "what is AppleScript?" And "Why should I care, anyway?"

Chapter 2, "Where To Use AppleScript," outlines various areas on the computer where AppleScript can be put to advantage, with a discussion of the Script Editor utility as well as some third party alternatives, Apple's AppleScript Studio, and using AppleScript with Cocoa, Unix, hyperlinks, and the Automator.

Chapter 3, "Basic Concepts," is an explanation of the technologies underlying AppleScript and a glossary of fundamental terms that will come in handy reading this book, such as Apple Events, scriptability, the open scripting architecture, various types of scripts, compiling and decompiling, applets and droplets, and scripting additions, modes of scriptability, recordability and attachability. While readers with some experience using AppleScript can probably safely skip the first two introductory chapters, the author suggests that they should definitely read this one.

Part II, "The AppleScript Language" discusses AppleScript as a programming language. The author recommends that beginners read the 16 chapters of this section in order, while experienced users can skim over or just use it as a linguistic reference.

Chapter 4, "Introducing The Language," is a subjective description of what AppleScript is like as a language, to help give newcomers a feeling of what they're getting into.

Chapter 5, "Syntactic Ground Of Being," describes some fundamental externals of the language such as lines and comments.

Chapter 6, "A Map Of The World," surveys the constituent parts of an AppleScript program will (as discussed in detail in the ensuing four chapters).

Chapter 7, "Variables," discusses how to assign and define variables and how their names should look.

Chapter 8, "Script Objects," discusses, well, script objects (scripts within scripts), including how to refer to them, how to load and save them dynamically, and how inheritance works.

Chapter 9, "Handlers," shows how to declare and call handlers (subroutines), along with some powerful and interesting and advanced devices for expressing parameters and returning values.

Chapter 10, "Scroll," discusses the visibility and storage of declared and undeclared variables, along with some advanced techniques involving free variables and closures.

Chapter 11, "Objects," describes how objects are targeted, and how their attributes (properties and elements) are referred to.

Chapter 12, "References," describes a device for encapsulation and delayed d=evaluation of expressions targeting objects and referring to their values.

Chapter 13, "Data Types," is a guide to the built-in value classes (such as numbers, strings, lists, and records).

Chapter 14, "Coercions," explains how one data type can be turned into another explicitly or implicitly.

Chapter 15, "Operators," catalogues the various ways to test and combine values, such as the addition, comparison, and concatenation.

Chapter 16, "Global Properties," catalogs some predefined variables, such as (believe it or not) pi.

Chapter 17, "Constants," catalogs enumerations and classes at behave as reserved words.

Chapter 18, "Commands," catalogs the few built- in verbs not previously covered.

Chapter 19, "Control," surveys the linguistic strictures for determining the flow of an AppleScript program, such as branching, looping, and error handling.

Part III, "AppleScript In Action," moves beyond theory to AppleScripting in practice, and its relation to the wider world.

Chapter 20, "Dictionaries," discusses the mechanism where by applications make themselves scriptable through AppleScript by extending the AppleScript language, and explains how terminology is resolved and how to read and understand a dictionary.

Chapter 21, "Scripting And Additions," explains the scripting in addition mechanism; surveys the built-in scripting additions, and provides some additional technical details.

Chapter 22, "Speed," collects some tips for optimizing the speed of AppleScript.

Chapter 23, "Scriptable Applications," explains how to drive applications with AppleScript, on the same or a different computer, including certain kinds of Web Services. The chapter also mentions some useful scriptable applications that come with Mac OS X.

Chapter 24, "Unscriptable Applications," explains how AppleScript can be used together with the system's accessibility API to automate the interface of applications that are not directly scriptable.

Chapter 25, "Unix," talks about how AppleScript can call the Unix shell command line and how Unix scripting languages can call AppleScript.

Chapter 26, "Triggering Scripts Automatically," describes ways that an application or process can find and call your script automatically, including folder actions, CGI, and attachability.

Chapter 27, "Writing Applications," explains how to turn an AppleScript program into a standalone application, ranging from a simple applet (written with AppleScript alone), to a full-fledged application a true user interface or an Automator action (written with AppleScript Studio). This chapter also introduces the techniques whereby a developer can add scriptability to an Objective-C Cocoa application.

Part IV contains the three appendices. There is also a very thoroughgoing 39-page Index.

I would suggest especially making a point to read Appendix A, "The AppleScript Experience," early on in your AppleScript journey, as it contains descriptions and workarounds for potential hurdles you will likely encounter climbing the AppleScript learning curve.

This book is what it claims to be; a thorough and comprehensive guide to learning and working with AppleScript. It is neither light reading nor too technologically esoteric and opaque for dedicated beginners to find accessible. However, as you have probably cognated reading the chapter summary, it is a serious book. If you want to learn AppleScript from scratch or hone your skills in the language, AppleScript,: The Definitive Guide will teach you what you need to know and walk you through the learning process, but be prepared to contribute some effort. This book isn't a shortcut, it's the full, scenic route.

AppleScript: The Definitive Guide, Second Edition
Scripting and Automating Your Mac
By Matt Neuburg
Second Edition January 2006
Pages: 590 (More details)
Price: $39.99 USD, $55.99 CAD, £28.50 GBP

You can check it out online at the Safari Bookshelf:
http://safari.oreilly.com/?XmlId=0596102119

For more information, visit:
http://www.oreilly.com/catalog/applescpttdg2/



Charles W. Moore




Tags: Hot Topics ï News ï Reviews ï Book Reviews ï MooresViews ï

Login † or † Register † †

Follow Us

Twitter Facebook RSS! http://www.joeryan.com Joe Ryan

Most Popular

iPod




iPhone

iLife

Reviews

Software Updates

Games

Hot Topics

Hosted by MacConnect - Macintosh Web Hosting and Mac Mini Colocation                                                    Contact | Advanced Search|