Chapter 8. Automator and AppleScript

 <  Day Day Up  >  

If you use your Mac long enough, you're bound to start repeating certain jobs over and over again ”renaming files, for example, or importing music files into iTunes. A Windows user would simply accept this tedium as a cost of using the computer, and move on. But you, time-starved Mac fan, know there has to be an easier way.

In fact, there are two.

  • Automator , new in Mac OS 10.4, is a program that lets you teach your Mac what to do, step by step, by assembling a series of visual building blocks called actions . Drag actions into the right order, click a big Run button, and your Mac faithfully runs each action one at a time (Figure 8-1, top).

    You have a list of preprogrammed actions at your fingertips, so you never have to go poking around reference files to find out, say, how to control Text Edit. So creating the little software robots (called workflows ) is exceptionally easy.

    On the other hand, your selection of building blocks is limited to what other programmers have already written, so Automator workflows are limited in what they can do. You can't automate a complex newspaper layout using Automator alone, for example, because nobody has written the building-block actions necessary to control all the stages of newspaper production.

  • AppleScript is the other, much older way of automating your Mac. You type out English-like commands in a text file called a script , one command per line, and click Run to have your Mac carry out the result (Figure 8-1, bottom).

    AppleScript is a power user's dream come true, but it's a programming language. If you want to automate even a simple custom job like converting music files to MP3s, you have to get your hands dirty hunting for the AppleScript command that does exactly what you want ”and that can be a real pain.


Note: One reason AppleScript is so powerful is that it's been cultivating a following for over a decade . Already, AppleScript commands are available in the software programs from hundreds of companies. As Automator ages, you can expect a similar blossoming of Automator actions, too ”you just might have to wait a few years .

Figure 8-1. The two faces of Mac automation.
Top: Automator uses a visual, step-by-step metaphor for automation; the down-pointing arrows indicate how each building block "feeds" its result into the next action. You can usually tell what an Automator workflow does at a glance.
Bottom: Script Editor (the program you use to write and edit AppleScript code)is a little geekier. There's a good amount of programmerese here, and you have to know basic AppleScript syntax before you can begin to understand this script ”let alone write your own.


 <  Day Day Up  >  


Mac OS X. The Missing Manual
Mac OS X Snow Leopard: The Missing Manual (Missing Manuals)
ISBN: 0596153287
EAN: 2147483647
Year: 2005
Pages: 506
Authors: David Pogue

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net