As is usually the case, it took some external forces to instigate the motivation to learn AppleScript, but once the motivation was there the language was really easy to grasp. The big rumor about AppleScript is that “it’s easy because it’s exactly like English.” Unfortuantely, that’s not entirely true. AppleScript is just like any other programming language and it has its own set of rules for grammar and syntax which you need to know in order to get a script working. The good news, however, is that once you understand the basics you can start typing out full lines of English-only words instead of punctuation marks like parenthesis and periods and curly braces, and you’ll actually be writing real, working code.
What’s even nicer about AppleScript is that there’s no worry about formatting or style, because the compiler forces extremely stringent restrictions on the syntax of your code the moment you’re done typing. This is good because it means (if you’ll allow me to simplify things for a moment) there aren’t twenty different ways of saying the same thing; once you type what you mean, the compiler changes it just enough to match the standard AppleScript idiom. This is especially helpful when you’re looking through other people’s code.
The single most important resource I’ve been using in my quest to master AppleScript has been Matt Neuburg’s fantastic book, AppleScript: The Definitive Guide, 2nd Edition from O’Reilly Publications. Rather than focus on the syntax and grammar up-front (which, honestly, is the easy part of every language) it goes into detail about the technology of AppleScript and how it works in Mac OS X. This is of great benefit to understand while you’re learning the nuts and bolts of the syntax because you’ll be more able to debug your code even if you see errors you don’t understand because you will understand how things are supposed to work.
And of course, once you’ve figured out how to do something in AppleScript, you begin to grasp the nearly infinite ability your Mac has to work for you, instead of the other way around.