Chapter 7. AppleScript
You can think of AppleScript programs (called scripts) as software robots. A simple AppleScript might perform some daily task for you: backing up your Documents folder, for example.
A more complex script can be pages long. In professional printing and publishing, where AppleScript enjoys its greatest popularity, 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 technology that underlies AppleScript all the time. Behind the scenes, numerous components of your Mac communicate with each other by sending Apple Events, which are messages bearing instructions or data that your programs send to each other. When you use the Show Original command for an alias, or the Get Info command for a file or folder, an Apple Event tells the Finder how to respond. Some of the files in the Speakable Items folder (Section 14.4.2.4), furthermore, are AppleScripts that quit your programs, open AppleWorks, switch a window into list view, and so on.
AppleScript veterans will find a lot of enhancements in Mac OS X 10.3—and there’s a nice surprise for first-timers, too.
Running Ready-Made AppleScripts
You don’t have to create AppleScripts to get mileage out of this technology. Mac OS X comes with several dozen prewritten ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access