Section 13.6. Automator Tricks


13.6. Automator Tricks

If you use your Mac long enough, you're bound to start repeating certain jobs over and over again. Automator, introduced 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.

As it turns out, Automator works great with iPhoto. By following "recipes" that you find onlineor the sample described hereyou can add all kinds of new, time-saving features to iPhoto and your Mac.

13.6.1. The Lay of the Land

To open Automator, visit your Applications folder. When you open Automator, you'll see something like Figure 13-11, starring these key elements:

13.6.1.1. Library list

The Library list shows you every program on your Mac that can be controlled by Automator actions: iPhoto, Safari, TextEdit, iTunes, and so on. When you select a program, the Action list shows you every action (command) that the chosen program understands. When you find an action you want to use in your workflow, you drag it to the right into the large Workflow pane to begin building your software robot.

13.6.1.2. Action list

This list shows you the contents of whatever categories you've selected in the Library list. If, for example, you selected Safari in the Library list, the Action list would show you all the Safari actions available on your Mac. To build your own workflow, you have to drag actions from the Action list and into the Workflow pane. (Double-clicking an action does the same thing as dragging it.)

13.6.1.3. Workflow pane

The Workflow pane is Automator's kitchen. It's where you put your actions in whatever order you want, set any action-specific preferences, and fry them all up in a pan.

But the Workflow pane is also where you see how the information from one action gets piped into another, creating a stream of information. That's how the Workflow pane differentiates Automator from the dozens of non-visual, programming-based automation tools out there.

When you drag an action out of the Action list into the Workflow pane, any surrounding actions scoot aside to make room for it. When you let go of the mouse, the action you dragged materializes right there in the Workflow pane.


Tip: If you select an action in the Action list and press Return, Automator automatically inserts that action at the bottom of the Workflow pane.
Figure 13-11. The process of writing an Automator program (workflow) is always the same.
First, click the name of the program you want to manipulate (in the far left column).
Then, locate the specific action you want that program to take (in the second column). You can use the Search box to help you with this.
Finally, double-click that action's name, or drag it, to place it into the far right column. Save the result as a real, double-clickable program.

13.6.2. Automating iPhoto

To help you get started, here's a three-step workflow (automated software sequence) that you can construct in minutes (or download, already completed, from www.missingmanuals.com). It addresses an age-old iPhoto limitation: The program doesn't let you import only some photos from your camera's memory card (or from a folder of images on your hard drive). You'll wind up with a window full of thumbnails, which you're free to choose selectively for importing into iPhoto. Neat!

Here's how to build this workflow yourself.

  1. Open Automator .

    It's in your Applications folder.

  2. In the Library column, click Finder .

    The Action column now displays the commands that Automator can issue to the Finder (Figure 13-10).

  3. In the Action column, double-click "Get Specified Finder Items ."

    Figure 13-12. Here's what happens when you run your completed Automator software robot.
    Top left: Automator asks you for the images you're considering importing into iPhoto. Click the + button.
    Second from top: Navigate to your memory card (which is either in your camera or in a card reader), or to the images on your hard drive. Select all of the photos inside by clicking the first one in the list, and then Shift-clicking the last one. (Do not select the entire card or folder; you must highlight all of the actual photo files.)
    You return to the Get Specified Finder Items dialog box (top left), where your candidate photos now appear. Click Continue.
    Third from top: This cool interview screen displays each picture. Click Approve ("Yes, import this one") or Reject ("No, I don't want this one") for each photo.
    Bottom: You're asked to name the album that will hold the approved photos. When you click Continue, iPhoto automatically opens, imports the selected photos, and places them in the album you've just named.

    It appears in the rightmost column as step 1. You've just told Automator, "Work with the icons that I'm going to specify." Now you have to specify them.

  4. Click to expand the Options flippy triangle. Turn on "Show Action When Run ."

    This means: "When this software robot does its thing, I want to be asked which files to process."

  5. In the Library column, click iPhoto. In the Action column, double-click Review Photos .

    It flies to the right, becoming the second step of your workflow. Make sure the Approved Images box is turned on.

  6. In the Action column, double-click "Import Photos into iPhoto." When it appears in the rightmost column, click New Album .

    Translation: "The thumbnails I select, I want imported into iPhoto, in an album."

  7. Click to expand the Options flippy triangle. Turn on "Show Action When Run." Then click "Show Selected Items," and, in the list, select New Album .

    You've just told the workflow to put the imported pictures into a new album (as opposed to an existing one).

  8. Choose File Save As. From the File Format popup menu, choose Application. Name your new workflow (something like Import Selected Photos ), and then save your masterpiece to the desktop .

    Ignore any error message that appears; it's a bug.

The fruit of all this labor is a new programthat you wrote called Import Selected Photos. You can drag it into your Dock, leave it on the Desktop, or whatever.

From now on, whenever you double-click this new program, you'll be guided through the process of choosing the worthy photos from your memory card (or hard drive) and importing them into iPhoto! Figure 13-11 illustrates the process. No longer must you import all the photos on your memory card, wasting time and disk space.


Tip: A new, improved "Import Photos into iPhoto" action works much better than the original one that comes with iPhoto. You can download it from this book's "Missing CD" page at www.missingmanuals.com. (It's easy to install. Just unzip the archive and double-click the Automator icon inside. You'll now see the action listed in Automator, ready to use.)



iPhoto 6
iPhoto 6: The Missing Manual
ISBN: 059652725X
EAN: 2147483647
Year: 2006
Pages: 183

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