As a photographer, you tend to run through the same mind-numbing tasks over and over again: editing, resizing, saving, and so on—it’s a glamorous life. Adobe Photoshop does offer some automation controls, but their powers are relatively limited. That’s one reason I think Automator, Tiger’s easy-to-use automation tool, is one of the most exciting parts of Apple’s latest operating system.
More than just a macro program, Automator lets you create complex procedures that span multiple applications. And you can trigger Automator workflows from the Finder; you can’t do this with the tools in Photoshop. Although Automator doesn’t come with Photoshop actions built in, you can quickly add Photoshop CS and CS2 support to its repertoire.
Download the actions
Automator ships with actions for many of OS X’s built-in applications, including the Finder, iCal, Preview, and Spotlight. But if you scan the list of applications in the Library pane, you’ll notice that there aren’t any actions for Adobe Photoshop.
Fortunately, Apple has made it extremely easy for developers to add Automator support for programs. Because neither Adobe nor Apple has offered actions for Photoshop, I created my own—a suite of 42 actions for controlling Photoshop CS and CS2. You can download them for free. Once you’ve downloaded and expanded the SIT file, drag the Action Pack item into your Adobe Photoshop folder. When you launch Automator, you should see an entry for Photoshop in the Library pane.
Build your workflow
Now that you’ve added Photoshop actions to Automator, you can string them together to accomplish any number of tasks. For example, say you’ve shot a few dozen pictures with your digital camera and you want to upload them to your Web gallery for viewing. This means resizing them based on their orientation (landscape or portrait), applying basic image correction, adding copyright information, and compressing the files (see screenshot).
(Click image to open full screenshot)
Here’s how you would build this basic workflow in Automator:
Step 1: Filter Your Files Before you resize a group of images, you need to separate the horizontal (landscape) shots from the vertical (portrait) ones so you can apply different settings to each. In Automator’s Library pane, choose Applications: Photoshop CS (or Photoshop CS2, depending on the version you installed). In the Action pane, select the Filter From Orientation action and drag it to the Workflow pane. Set the action’s pop-up menu to Landscape.
By the way, orientation isn’t the only option for filtering your images. You can filter by aspect ratio, color mode, size, and more. You can even combine these filters to create more-refined filters—for example, to choose only landscape gray-scale images shot at an ISO setting of 100 (use Filter From Orientation, then Filter By Color Mode, and then Filter From EXIF).
Select the Save Document List Before Filtering option to save a copy of the original list of files. This will let you return to the original list later so you can refilter for portrait-oriented documents. Now select None from the Close pop-up menu. This will leave all of the documents open in Photoshop, saving time.
Step 2: Resize the Images Next, in the Action pane, select the Resize Image action and drag it to the Workflow pane, beneath the Filter From Orientation action. Make sure the Units menu is set to Pixels. Then enter
800in the Width field and
72in the Resolution field. Select the Resize Proportionally option to have Photoshop automatically calculate an appropriate height for your image.
Step 3: Unfilter the Batch Now that you’ve resized your landscape images, you’ll want to turn your attention to the portrait ones. To return to the original batch of images, drag an Unfilter action to the bottom of your workflow.
Step 4: Filter for Portrait and Resize Repeat steps one and two—this time setting the Filter From Orientation pop-up menu to Portrait. Again, select the Save Document List Before Filtering option and set the Close menu to None. In the new Resize Image action, enter
600in the Height field and
72in the Resolution field, and select Resize Proportionally. Now you have a workflow that resizes images to dimensions appropriate to their orientation.
Step 5: Unfilter Again To ensure that the rest of the workflow will apply to your entire batch of images—not just to the portrait shots—drag another Unfilter action to the bottom of your workflow.
Step 6: Apply Correction If the images came straight from your camera, you might want to improve their contrast with Photoshop’s Auto Levels command. Drag the Auto Levels action to the end of the workflow.
Step 7: Add Copyright Info When you put your images on the Web, it’s a good idea to give yourself a little ownership protection. Many file formats, including JPEG, let you include special bits of text called IPTC tags within files.
Drag the Edit IPTC Info action to the bottom of your workflow and put your name in the Author field. Set Copyright Status to Copyrighted, and enter
Copyright © 2005and your name in the Copyright Notice field. You might also consider adding your Web site’s URL in the © Info URL field, to ensure that people can find you.
Select Append to save changes only to the tags you’ve modified. (Leaving Replace selected will overwrite all existing tags.)
Step 8: Set the File Type Now you’re ready to save your resized images. Drag the Save As JPEG action to the workflow. To keep the file size small, enter
7in the Quality field. Click on the Destination button and choose a folder to save your images into. Open the Option menu and select Show Action When Run. When you run the workflow, it will stop at this action and give you the opportunity to enter a new file name and destination. If you leave the New Name field blank, the files will maintain their original file names. Alternatively, you can enter a new name, and the action will give all of the resulting images that name plus a sequential number. Finally, put a check mark in the Close After Saving check box.
Save your workflow
Once you’ve finished your workflow, choose Save As from the File menu. Set File Format to Application. Then give your Automator workflow a name such as Prep For Web and click on Save. You should see a new application icon on your desktop. Your workflow will process any images you drop onto this application.
Note that Automator doesn’t take each image and run it through the entire workflow. Rather, Automator performs each action on the entire batch before moving on to the next action. If you’re processing a lot of images, this can cause your machine to bog down a bit. If that happens, process your images in smaller batches.
Actions within actions
But what if you want to automate a Photoshop process that isn’t included in the list of Automator actions? For example, you might want to add a watermark that stamps your name onto the processed images. In this case, you can call on Photoshop’s own automation tools.
Open Photoshop and create a new 800-by-600-pixel document. Open the Actions palette and create a new action called Add Watermark. Save the action into the Default Actions set. Next, click on Record. Select the type tool, choose a color, type your name on the bot-tom edge of the document, flatten the image, and stop recording (see screenshot).
Return to the previous Automator workflow. Drag a Do Action action into your workflow, just below the Auto Levels action. In the Do Action field, enter the name of the action you just created in Photoshop. This field is case sensitive, so be sure to type the action’s name exactly as it appears in Photoshop’s Actions palette. When you run the action, you should end up with resized images emblazoned with your Photoshop-generated watermark.
Access other applications
One of Automator’s most useful features is its ability to control multiple applications within a single workflow. For instance, now that you’ve resized your images, why not have Automator transfer them to your Web server for you?
If you happen to use Panic’s Transmit 3 ($30) for your FTP chores, you can set its Automator actions to do the trick. If you don’t, OS X has a built-in FTP client—though you can normally access it only from the command line. To access it from within Automator, download Peter Dekkers’s free Upload To FTP action, which lets you transfer files via Automator.
Once you’ve downloaded the action, restart Automator and open your saved workflow. Scroll to the Save As JPEG action at the end of the workflow and select the Pass Saved Files Instead Of Originals option. This tells Automator to pass your new JPEG files, rather than your originals, to the next action.
Drag the Upload To FTP action to the bottom of the workflow and configure it with your server settings.
Now, at the click of your mouse, you can take your photos from the camera, run them through a basic editing routine, and plop them onto your server. If only Automator could also brew coffee, it would be perfect.
Just scratching the surface
In theory, my 42 Photoshop actions can be organized in 1.405 x 1059 combinations. Here are just a couple of the possibilities:
Organize After a Shoot Using the Rename From EXIF action, you can quickly rename an entire batch of photos using the data recorded by your camera—including date, time, ISO speed, and more. Then add the Finder’s Copy Finder Items action to the end of your workflow to back up your new files automatically to another volume.
Prep for Video If you regularly use Photoshop files in a DV workflow, the Change Pixel Aspect Ratio action will let you set an image’s pixels to a rectangular aspect ratio. The NTSC Colors action will make your images NTSC-safe. The Deinterlace action will clean up stills that you’ve grabbed from video for use elsewhere.
[ Frequent Macworld contributor Ben Long is working on an Automator action that will write these articles for him. ]