Articles / AppleScript: The Definitive…

AppleScript: The Definitive Guide

AppleScript: The Definitive Guide most certainly is a definitive guide, with an awful lot of information about anything and everything you could possibly want to know about AppleScript. The problem is that the nuggets of useful information are often hidden deep within either complicated examples revolving around expensive specialist software, or in amongst extremely detailed in-depth examinations of the underlying processes running AppleScript. Although interesting to some, this will be a little daunting to the average programmer attracted to AppleScript. However, the book is definitely an excellent reference for existing AppleScript programmers, those who have some previous knowledge in programming, or those interested in MacOS X technology.

Part I is a detailed look at the history and concepts underlying AppleScript. It looks at concepts such as compiling, the different forms AppleScripts can take, the dictionary concept, and oddly, an entire chapter devoted to detailing exactly how the author solved a particular problem in the software he was using to write the manuscript for this very book. He suggests that this chapter "doesn't actually teach any AppleScript", but that the "neophyte may benefit by witnessing [his procedures and thought processes]". While this may indeed be true, it's rather frustrating that he used such a specialist piece of software (Adobe FrameMaker) for his example, because it would have been nice to be able to learn from example by copying the example as he stepped through it. Although the accompanying explanations are worded in plain English, it becomes easy to wonder why "neophytes" would be interested in looking at such a detailed and complicated example when they haven't even started on the base concepts of the language yet. This chapter left me completely confused as to his aim for it. For the "neophyte", it's far too complicated. For veteran programmers looking to learn about a new language, well, they'd just skip this chapter entirely.

Another chapter in Part I looks at some basic concepts. Neuburg uses this chapter to give some in-depth examinations of Apple events. Unfortunately, he goes into great detail showing the logs of the event in the Console without actually explaining what all the mess of code returned is, which makes the inclusion of several of these logs somewhat useless and possibly confusing to the first-time programmer, for whom this whole section is recommended reading (as suggested in the Preface). While understanding how to use Apple events in programming is important, the extra stuff really isn't needed at the novice level.

To be honest, I wouldn't suggest Part I to novice programmers unless they were particularly technically minded and really interested in the underlying concepts of how AppleScript talks to the operating system and other applications. Part I may be of use if there is a particular concept that crops up that is not explained elsewhere, or for interest's sake, but it is not essential to learning the language itself. This isn't to say that there aren't some useful things in Part I, such as the information on compiling scripts, the basic overview of Apple events, and the first example of an AppleScript Studio interface (although this inexplicably uses RealBasic, which is not included with MacOS X, as part of its example, much to my irritation), but these are somewhat hidden amongst seemingly useless examples and information.

Part II actually gets into the meat of the language, so is an ideal place for novice and veteran programmers alike to begin. In Chapter 6, Neuburg has a difficult job, because it is tricky to explain how to return the result of an operation without going into a detailed critique of all the different ways that AppleScript can do this. The main thing that annoyed me in this chapter is that he uses comments in his example code before he explains what they are (a whole two sections later). Otherwise, it's a great introduction to AppleScript syntax. The next chapter is a solid chapter on variables, including an informative and detailed look at variable scope, and the chapters that follow are equally well written and explained. Although he goes into a lot of detail that may be daunting to the novice programmer, it's warranted here because, well, it is the definitive guide. Besides, it's quite informative and a good reference, so novices can easily skip over any bit they're not sure about until it comes back to haunt them later in their AppleScripting careers. Perhaps this chapter would have been better split into beginners and advanced chapters, but I actually think that, on the whole, it's good to have the references in one place, because it's often difficult to work out where beginners information ends and advanced begins.

Part III is a look at "AppleScript in Action". As you may have noticed, I have complained about the author's use of specialist software that isn't included by default with MacOS X. Here he continues this train, using BBEdit, Eudora, NoteTaker, and Fetch, along with many other pieces of software that I certainly don't have installed. Why he couldn't have used standard MacOS X software, or freely available software such as TextEdit, SubEthaEdit, Mail, Safari, iTunes, or any of the other myriad AppleScript-capable pieces of software available is beyond me. However, he uses these to illustrate some good examples, and goes on to deal with unscriptable applications, XML-RPC, interaction with Unix-based scripting, and, finally, writing GUI applications using AppleScript and Xcode.

Ultimately, I think the book is quite useful as a reference and more advanced programming guide, but novices should be aware that it is really not necessary to understand the complex nuances of the language or underlying technology that he describes to get your own simple AppleScript script up and running pretty quickly. The use of non-standard proprietary software in example code is a significant drawback to making this book widely useful, but as a reference for the AppleScript language, interoperation, and history, it is a reasonable investment.

Recent comments

26 Nov 2006 14:04 Avatar JOBlogger

Re: Free sample chapter.


>

> %

> % % I've before never in my life had

> used

> % % Applescript and I needed somewhat

> of

> % a

> % % reference to compare to other

> % languages,

> % % the Book is quite good for the job.

> % %

> % % Chapter 7 is freely available to

> % % download from Oreilly's website and

> % all

> % % code samples used in the Book are

> % also

> % % available from the author's

> website.

> % %

> % % Mel.

> %

> %

> % Gone through the freely available

> % chapter and looked interesting thanks

> % for the info

>

>

> the frely available chapter is quite

> interesting

I also just printed out the freely chapter - thanks for the tip!

12 Jun 2006 19:57 Avatar meetme704

Re: Free sample chapter.


>

> % I've before never in my life had used

> % Applescript and I needed somewhat of

> a

> % reference to compare to other

> languages,

> % the Book is quite good for the job.

> %

> % Chapter 7 is freely available to

> % download from Oreilly's website and

> all

> % code samples used in the Book are

> also

> % available from the author's website.

> %

> % Mel.

>

>

> Gone through the freely available

> chapter and looked interesting thanks

> for the info

the frely available chapter is quite interesting

18 Feb 2006 02:10 Avatar mass999

Re: Free sample chapter.


> I've before never in my life had used

> Applescript and I needed somewhat of a

> reference to compare to other languages,

> the Book is quite good for the job.

>

> Chapter 7 is freely available to

> download from Oreilly's website and all

> code samples used in the Book are also

> available from the author's website.

>

> Mel.

Gone through the freely available chapter and looked interesting thanks for the info

12 Feb 2006 04:06 Avatar andreo_j_k

Re: Second Edition


> The second edition just got released.

> The updated oreilly url is:

> http://www.oreilly.com/catalog/applescpttdg2/index.html.Amazon's

> price is far better though. Make sure

> you're getting the second edition. The

> large print link says second edition but

> the standard edition doesn't.

> Weird!Barney

the amazon did not have the second edition yet i am looking for it thanks for the info

06 Feb 2006 12:03 Avatar b4rney

Second Edition
The second edition just got released. The updated oreilly url is:
http://www.oreilly.com/catalog/applescpttdg2/index.html (http://www.oreilly.com/catalog/applescpttdg2/index.html).

Amazon's (http://www.amazon.com/gp/product/0596005571/103-5241288-5535067?v=glance&n=283155) price is far better though. Make sure you're getting the second edition. The large print link says second edition but the standard edition doesn't. Weird!

Barney (http://www.xfusion.co.uk/)

Screenshot

Project Spotlight

Kigo Video Converter Ultimate for Mac

A tool for converting and editing videos.

Screenshot

Project Spotlight

Kid3

An efficient tagger for MP3, Ogg/Vorbis, and FLAC files.