05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

412<br />

CHAPTER 23 MAC <strong>OS</strong> X AUTOMATION WITH AUTOMATOR AND APPLESCRIPT<br />

Finally, drag a Start Screen Saver action from the Utilities group, and click Run. Pretty cool,<br />

right? You can save your workflow and open it in Automator any time, or you can save it as<br />

application, as shown in Figure 23-14. Now you can keep it in the Dock and, whenever you<br />

want, launch a new screen saver depending on your mood.<br />

Figure 23-14. Saving an Automator workflow as an application<br />

TIP You can drag the title of your newly minted application directly from the Automator window’s<br />

title bar into the Dock.<br />

When you’re running an Automator workflow in Automator, it’s pretty obvious what’s happening.<br />

You can watch each action execute sequentially, examine the results, and watch the<br />

actions add messages to Automator’s log.<br />

When Automator is closed and you launch your application from the Dock, it’s not immediately<br />

obvious that anything is happening. Since it takes a while to download all those images,<br />

it would be nice to have a status report. Fortunately, the Automator runtime does this for you<br />

automatically. When you run your new application, check out the status (and Cancel button) in<br />

the menu bar, as shown in Figure 23-15.<br />

Figure 23-15. Automator workflow status in the menu bar<br />

How Automator Works<br />

Automator actions are actually tiny applications. They can be written as shell scripts, or they can<br />

be full-fledged programs written in Objective-C (and by extension, plain C). However, most<br />

Automator actions don’t do very much, instead deferring to existing applications on the system.<br />

Automator doesn’t have any kind of magical ability to control other applications. It simply<br />

puts a convenient UI on an existing technology, the <strong>Mac</strong> <strong>OS</strong> X Open Scripting Architecture<br />

(<strong>OS</strong>A). You don’t need to use Automator to take advantage of the <strong>OS</strong>A. You can also address it<br />

in its native language: AppleScript.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!