Automator in OS X Mountain Lion
Automator in OS X Mountain Lion is “programming without writing code.” One of Mountain Lion’s automation tools, Automator enables you to string together prefabricated activities (known as actions) to automate repetitive or scheduled tasks. How cool is that?
Automator does just what you’d expect: It enables you to automate many common tasks on your Mac. If it sounds a little like AppleScript to you, you’re not mistaken; the two have a common goal. But this tool (introduced in OS X Tiger) is a lot simpler to use, albeit somewhat less flexible, than AppleScript.
For example, in AppleScript, you can have conditionals (“if this is true, do that; otherwise do something else”), but Automator is purely sequential (“take this, do that, then do the next thing, and then . . .”).
The big difference is that conditionals allow AppleScripts to take actions involving decision-making and iteration (“while this is true, do these things”); Automator workflows can’t make decisions or iterate.
The upsides to Automator are that you don’t have to know anything about programming, and you don’t have to type any archaic code. Instead, if you understand the process you want to automate, you can just drag and drop Automator’s prefab Actions into place and build a workflow (Automator’s name for a series of Actions).
You do need to know one thing about programming (or computers), though: Computers are stupid! Computers do only what you tell them to do, although they can do it faster and more precisely than you can. But all computers run on the GIGO principle — garbage in/garbage out — so if your instructions are flawed, you’re almost certain to get flawed results.
A similarity between Automator and AppleScript is that it’s up to the developers of the applications you want to automate to provide you the Actions or scripting support. Not all developers do so.
For example, in Apple’s wonderful iLife suite of multimedia applications, iTunes, iPhoto, and iDVD are all AppleScript-able — and they’ve supplied Actions for Automator users. iMovie and versions of GarageBand prior to GarageBand ’09 don’t support AppleScript. Furthermore, iMovie, GarageBand, and iWeb don’t include any Automator actions at this time.
When you launch the Automator application, you see the window and sheet shown here. Choose one of the starting points if you want Automator to assist you in constructing a new workflow, or choose Workflow to start building a workflow from scratch.
Choose Service for the sake of this demonstration (you see why in a second). You see the window shown here.
The Library window on the left contains all the applications Automator knows about that have actions defined for them. Select an application in the top part of the Library window, and its related actions appear below it.
When you select an action, the pane at the bottom of the Library window (Text to Audio File) explains what that Action does, what input it expects, and what result it produces. Just drag Actions from the Action list into the window on the right to build your workflow.
This particular Service is quite useful. First, select text from any source — a web page, Microsoft Word document, e-mail message, or whatever. Then right-click or Control-click and select the newly created Text-to-Audio Service from the Services menu.
OS X then converts the selected text into an audio file, which you can have read to you in iTunes at home, or on your iPhone or iPad in the car, on a plane, or just about anywhere. Sweet!
Automator is a very useful addition to OS X; it’s deep, powerful, and expandable, yet relatively easy to use and master. Do yourself a favor, and spend some time experimenting with ways Automator can save you time and keystrokes. You won’t regret it.