8.3. Workflows as Programs and Plug-ins

 < Day Day Up > 

Building an Automator workflow is a satisfying intellectual exercise and a delicious talent to acquire. But if the point of all the effort is to create a timesaving, step-saving software robot, there seems to be something missing. Are you really going to open the Automator program just to run a workflow you've written? Fortunately, that's not necessary. You can save a workflow as a regular, double-clickable application, if you like, or embed it in shortcut menus all over your Mac.

FREQUENTLY ASKED QUESTION
Checking a Workflow's Progress

Some of these actions take their sweet time. Is there some progress bar that will tell me how far along my workflow is ?

Actually, Automator provides two ways to check on the status of your workflow: the simple way (call it "the Indicator") and the Action Log.

The Indicator lies in the lower-right corner of the Automator window. When your workflow is running, a little status message appears here to tell you exactly which action is running at the moment. You can use that information, along with some common sense, to figure out how close your workflow is to being finished. If the workflow has run its course, the Indicator says,"Workflow Execution Completed."

(You can also identify whatever action is running at this moment, thanks to the spinning-sprocket indicator in its lower-left corner. But if you have a tall stack of actions, you might not be able to see the action that's currently running. The list doesn't automatically scroll.)

The Action Log, on the other hand, is even more powerful. It tells you when each action begins and ends, and it also displays geeky data-conversion information (like when Mac OS X is turning "image files" into plain- vanilla Finder files). And unlike the Indicator, the Action Log keeps its information around even after your workflow is finishedso you can see how long your entire workflow took to run, for example.

To display the Action Log, choose View Show Log (Option- -L). A short drawer pops out of your window that, when you run your workflow, fills in with progress information.

If you'd like even easier access to the Action Log, choose View Customize Toolbar, drag the Show Log button to your windows toolbar, and click Done. Now you'll have one-click access to the Action Log.

Once you're done using the Action Log for the day, choose View Hide Log (or, if youve added the button to your toolbar, click Hide Log there).


8.3.1. Saving a Workflow as an Application

When you've saved workflows over the past few pages, you've saved them as Automator Workflow files (you can tell because their filenames end in . workflow ). This is the format of most ready-to-use workflows you'll find online, too.

In the Save As dialog box, however, there's another choice for saving your workflows: as an application (Figure 8-11).

Figure 8-11. Automator has two choices for workflow formats: Workflow (the default) and Application (the non-default). If you're not sure which format you'll want to use for a particular workflow, you can save it once in each formatthe workflow will run equally well either way.


A workflow saved as an application has all the benefits associated with normal Mac OS X programs. You can double-click its Finder icon to launch it, drag it to the Dock for one-click launching, orwith the addition of file-launching shareware like LaunchBar or iKeyeven associate a key combination with it so that you can run your workflow with a quick press of a function key.

So why wouldn't you just save your workflows as applications all the time? First, workflow applications are much larger than workflow documentsas much as 20 times larger. That's a big deal if you plan to distribute your workflows online or via email, since dialup-using recipients will have to wait several minutes for your application to download.

Also, when a workflow application runs, it doesn't give you access to the Action Log (see the box on the facing page)a big downside if you want to monitor the progress of your workflow in minute detail. Instead, you get a dinky action indicator in the menu bar, as shown in Figure 8-12.

Finally, it's a pain to edit a workflow application if something goes wrong; you have to open the whole thing in Automator and resave it.

In any case, if you decide to save a workflow as an application, choose File Save As and choose Application from the pop-up menu at the bottom.

Figure 8-12. The three-part menu-bar indicator tells you that the workflow application is, in fact, running (the spinning progress indicator)and, more specifically , which action is running (the text next to it). If you want to cancel a workflow halfway through, click the Stop sign.


8.3.2. Using Workflows as Plug-ins

There's one more trick up Automator's sleeve, the best of the bunch: You can turn your workflow into a plug-in that can show up in any of several logical places all over the Mac, right where you want it. For example, workflows can show up in shortcut menus in the Finder, appear in the Script menu of your menu bar (Section 8.4), serve as an iCal alarm that runs automatically at a specified time, appear in the Print dialog box to process a document you've just finished, and more.

You'll see all of these options when you choose File Save As Plug-in. In the pop-up menu in the resulting dialog box, youll see these options:

  • Finder . Saving a workflow as a Finder plug-in is the most useful option of all. When you do so, a new item, named Automator, appears in the Finder's shortcut menuthe one that appears when you Control-click (or right-click) an icon or empty space in the Finder. Figure 8-13 has the details.

    This feature is most useful for Automator workflows that are designed to work with the currently selected Finder itemlike the workflows you can download from http://hublog.hubmed.org/archives/001120.html. The Play Fullscreen in QT workflow from this Web site, for example, takes any movie file you Control-click in the Finder and plays it in a cinematic full-screen modeprovided you save the workflow as a Finder plug-in.

    Figure 8-13. The Automator submenu is broken into two parts . Above the divider bar, Create Workflow is simply a quick way to jump to Automator and open a new workflow window. Below the divider bar, however, is where the real power lies. Here, you can run any of the workflows you've saved as Finder plug-ins simply by clicking their names. (Omitting spaces from your plug-in names is optional, but it increases your geek credibility exponentially.)


  • Folder Actions are workflows that run when you do something to a folder in the Finderopening it, say, or adding files to it. Folder Actions are tremendously powerful for image processing, network backup jobs, and much more, but they're also tremendously complicated. For a thorough explanation of the ins and outs, read this book's bonus AppleScript chapter (on the "Missing CD" page at www.missingmanuals.com), or visit www.apple.com/applescript/folderactions.

  • iCal Alarm is a powerful plug-in format that makes iCal run a workflow at any time you like. When you save a workflow in this format, iCal opens and creates a new event named after your plug-in; you're supposed to drag this event to whatever time and day you want the workflow to run. (You can even use iCal's "repeat" pop-up menu to have the workflow run every day, week, and so on.)

    This is truly a fantastic tool. If you have a workflow that plays an iTunes song, for example, you can easily build an alarm clock using nothing more than iCal alarms.

    POWER USERS' CLINIC
    Getting More Action(s)

    Automator comes with dozens of actions, but you're boundeventuallyto find yourself wishing that there were a few more. Perhaps you'd like some Automator actions to control a third-party program like Photoshop, or you'd just like to have a few extra actions for controlling Mac OS X itself.

    Fortunately, Automator can handle actions written by non-Apple programmers, too. Just visit any of the Web sites devoted to Automator actions (like www.automatorworld.com/category/actions/ or www.apple.com/downloads/macosx/automator/) and download any actions you'd like.

    If the action's programmers did their jobs right (and you downloaded the action using Safari), you can just sit back and watch as Mac OS X unpacks, copies, and installs the action automatically. The next time you open Automator, the new action will be listed in the correct category.

    If, on the other hand, the action's programmer decided to make life difficult and did not create a self-installing action, you may have to manually double-click the .dmg, .sit, or .zip file that you downloaded. Inside the folder or disk image that results, you should find a file ending in .action. Drag that file into either your Home Library Automator folder (to install the action for use under only your account) or your Library Automator folder (to install the action for all users on your Mac). In either case, if this is the first time youre installing an Automator action by hand, you may have to create the folder yourself.

    Once in Automator, you can use your new actions just as you'd use the ones that came bundled with your Mac: dragging and dropping them in whatever order you want, customizing their settings, and so on.

    Before you run any new actions, though, be sure to look at the Description field to discover the actions' inputs and outputs. With that information in hand, you'll never accidentally connect, say, your new Saut Vegetables action to an unrelated action like Burn a Disc.

    And finally, if you're interested in writing your own Automator actions (warning: programming experience necessary), visit http://developer.apple.com/documentation/AppleApplications/Conceptual/AutomatorConcepts/Automator.html for an introduction.


  • Image Capture is a program for importing photos from a camera or scanner (Section 10.12). If you save a workflow as an Image Capture plug-in, you can choose to run the workflow whenever you import new photosso you can easily shrink the new images to a smaller size , for example. See www.apple.com/macosx/features/imagecapture/ for a closer view of Image Capture.

  • Print Workflows show up as menu items inside the Print dialog box's PDF menu (Section 14.5.2.2). If you save a workflow as a Print Workflow plug-in, you can easily run the workflow on a document you're about to printapplying a ColorSync filter to the document to compensate for slight discolorations, for example.

  • The Script Menu , described on the next page, is a convenient list of AppleScripts. But if you save a workflow using this option, it, too, will appear in the Script menu (at the bottom). That's a convenient way to run your favorite workflows any time you want, from within any program.

    Now, go forth and automate!


    Tip: You can find extra Automator resources, including useful workflows and actions, at sites like www.automatorworld.com, www.automatoractions.com, and, of course, www.apple.com/automator.
 < 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