AppleScript

AppleScript is a powerful computer language that’s been around since the days of Mac OS 7. If you’re an everyday Mac fan—as opposed to some computer-science PhD—AppleScript is by far the easiest programming language to use for automating your Mac.

You can think of AppleScript programs (called scripts) as software robots. A simple AppleScript might perform some daily task, like backing up your Documents folder. A more complex script can be pages long. In professional printing and publishing, where AppleScript has hard-core fans, a script might connect to a photographer’s hard drive elsewhere on the Internet, download a photo from a predetermined folder, color-correct it in Photoshop, import it into a specified page-layout document, print a proof copy, and send a notification email to the editor—automatically.

Even if you’re not aware of it, you use the technology that underlies AppleScript all the time. Behind the scenes, numerous components of your Mac communicate by sending Apple Events, which are messages bearing instructions or data that your programs send to one another.

AppleScript has several important advantages over Automator—not the least of which is its even greater power. It comes with a dedicated program just for writing out these scripts. It’s the AppleScript Editor program that’s sitting in your Applications→Utilities folder.

Still, AppleScript is a very deep subject—so deep, in fact, that you’d need an entire book to do it justice. This chapter is an appetizer; ...

Get OS X Mavericks: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.