Photoshop Automator Actions

 by Ben Long

With the release of Tiger, Apple has unveiled a new workflow automation tool called Automator. Though at first glance it may seem like nothing more than a souped-up macro program, or an easy-to-use front end to AppleScript, Automator is much more than either of those, thanks to its integration into the Mac OS. And, though it lacks any built-in support for driving Photoshop, it's easy enough to add such capability with the plug-ins provided here, making Automator an exceptional digital photography workflow tool.

Automator lets you quickly create "workflows" by dragging commands into a flow-chart like diagram. Once you've created a workflow, you can point it at particular files, and let your Mac chug away on whatever tedious task it is that you don't want to do by hand. The commands that Automator provides are simply AppleScript-able elements from other applications. So, you might build a workflow that calls on some Preview commands to resize some images, and then some Finder commands to rename and move those adjusted images. Because Automator's reach extends far beyond the capabilities of any single app, it's much more than just a macro program.

This type of functionality was always possible with AppleScript, of course, provided you knew how to create a script. Creating workflows in Automator is substantially easier than AppleScripting, which should allow far more people to take advantage of automation features that the Mac has had for a long time. But Automator adds far more to your production pipeline than just an easy, graphical form of scripting. Automator has been tightly integrated into the Finder and the Mac OS, and so provides you with several powerful ways of utilizing your Automator commands and workflows.


Building a workflow in Automator

First off, you can simply create and run a workflow from within the Automator application itself. Deciding to use an automation tool can be a tricky decision because you don't want it to take more time to develop an automation routine, than it would take to simply do your chores by hand.

Fortunately, throwing some files into Automator and building a workflow for them is so easy, that you'll almost always save time by using Automator for repetitive tasks, than by doing them manually. For tasks that you know you'll regularly repeat, you can save your Automator workflow as a stand-alone droplet. Drop any files onto the droplet, and they'll be processed just as if you were running in Automator.

Automator's most useful delivery mechanism is its ability to create Finder plugins. If you save a workflow as a plug-in, it will appear as an option any time you control-click on a file in the Finder. This allows you to perform actions directly from the Finder, without having to go into a specific app. For example, if you've created a Resize Image workflow and saved it as a plug-in, you can simply select files in the Finder, control-click on them, select your Resize workflow, and the files will be automatically edited.

Apple ships Automator with a thorough selection of actions that range from Finder commands to Text Edit, Mail, iTunes, Safari, Spotlight, and the QuickTime Player. However, Tiger does not ship with any Automator actions for third-party apps. Fortunately, any application that is AppleScript-able can be integrated into Automator.

Though there's a lot you can do with Preview's image manipulation commands, there are still some basic functions that it lacks. For these operations, you'll need to turn to Photoshop. However, before you can access any of Photoshop's functionality, you need to find and install Automator Actions that let you access Photoshop's commands.

To this end, I’ve thrown together a bunch of Photoshop Automator Actions for Photoshop CS and CS2. Two archives are here for free download. One for Photoshop CS, the other for the new Photoshop CS 2.You can download either archive below. After unstuffing, simply drop the Photoshop Action Pack into your Photoshop folder and restart Automator. (If the actions don’t show up, try launching Automator while holding down the Option key.) Both versions include identical actions:

Arbitrary Rotate, which rotates an image by any amount (as opposed to the 90° increments provided by Preview’s Rotate command).
Change Mode, which lets you change the mode of a document to any of Photoshop’s standard modes.
Flatten Document, which flattens a layered file.
Unsharp Mask, which provides access to Photoshop’s standard Unsharp Mask plug-in.
Gaussian Blur, which provides access to Photoshop’s standard Gaussian Blur. UPDATED 7/17/05. Fixed a bug that, embarrassingly, sometimes caused the action to sharpen. You know, you almost have to TRY to make a mistake that stupid.
NTSC Colors, which applies Photoshop’s NTSC Colors filter.
De-Interlace, which applies Photoshop’s De-Interlace filter.
Monochrome Gaussian Noise, which applies Photoshop’s Add Noise filter, with Gaussian and monochrome hard-wired. The Amount value is editable.
Close Document. Closes the currently open document.
Edit IPTC Info. Lets you edit the basic IPTC information - Document Title, Author, Author Title, Description, Description Writer, Keywords, Copyright Status, Copyright Notice, Copyright Info URL. Updated 5/17/05. Added the additional IPTC fields supported by Photoshop’s AppleScript dictionary. Updated 6/4/05 Added the option to replace or append data so that you can control whether empty fields in your workflow wipe out existing tags in your document.
Flip Canvas. Applies Photoshop’s Flip Canvas command. Provides options for Vertical, Horizontal, or Both.
Auto Levels. Applies Photoshop’s Auto Levels command.
Desaturate. Desaturates the current document.
Despeckle. Applies Photoshop’s Despeckle filter.
Clouds. Applies the Clouds filter.
Save as TIFF. Saves the current document as a TIFF file. (Updated on 7/21/05 to fix a few bugs)
New Photoshop Document. Creates a new, empty Photoshop document of a specific size.
Do Action. Executes one of Photoshop’s internal Actions.
Rename from EXIF. Renames a file based on its EXIF information. Updated: 5/6/05 9:24 am. Fixed a bug that was causing some EXIF tags to not come through into the file name. Updated: 5/7/05 12:33 am. Added options for changing separator characters and placement of EXIF info. Updated: 6/19/05 9:47 am. Added options for sequential numbering, and changing the date formats. Also fixed a bug so that the action now correctly handles multiple files that end up generating the same name. Fixed a bug that sometimes placed extra spaces at the beginning of file names.
Open. Opens a Photoshop document.
Invert. Inverts the current document.
Load Selection. Loads an existing selection.
Deselect. Deselects in the current document.
Fit Image. Executes Photoshop’s Fit Image script which automatically constrains an image within particular dimensions. Ideal for batch scaling images to particular dimensions without having to perform separate operations for portrait and landscape images. Requires that you activate GUI Scripting, using the new AppleScript Utility located in Applications>AppleScript.
Filter From EXIF. Filters the current batch of pictures based on EXIF criteria. Allows you, for example, to only process images shot at a particular ISO.
Filter From Orientation. Filters the current batch based on each image’s orientation. Both this and the Filter from EXIF Actions can provide a workaround for Automator’s lack of logic and branching. This Action works off of image dimensions rather than EXIF orientation tags, since not all cameras provide them, and since Photoshop tends to change them during Save As operations.
Assign Color Profile. Lets you assign a color profile to the current document. Provides choices of none, current workspace, or any of Photoshop’s standard RGB, CMYK, or Grayscale profiles.
Assign Epson 2200 Profile. Lets you assign any of the color profiles that ship with the Epson Stylus Color 2200. (Creating these actions is really easy, so I’m game for requests for other popular printers.)
Filter by Aspect Ratio. Lets you filter a batch of images by their aspect ratio, so that only those that match your chosen ratio are passed on to the rest of your workflow.
Resize Image. Re-sizes the current image using bicubic resampling. I had put off doing an Image Size action since you can always resize images using Preview’s resize Action. However, if you’re performing other tasks in Photoshop, it will be faster to resize there, rather than going through an extra save and open to get into another app. Updated 5/19/05 Updated so that you can now adjust any one parameter without adjusting the others. So, you can change resolution only, or change the size of one dimension while leaving the other alone. Finally, you can change dimensions without changing resolution. Updated 5/24/05 Now performs proportional resizing. Enter either length or width, and it’ll calculate the other. Updated 5/25/05 Fixed a bug in the proportional resizing mechanism. Now calculates the correct size when working on batches of different-sized images. Sorry bout that.
Updated 7/28/05 Fixed a bug in the CS version to make the save box work.

Filter by Color Mode. Lets you filter a batch of images by their color mode, so that only those that match your chosen mode are passed on to the rest of your workflow.
Filter from IPTC. Filters your images by IPTC tags, so that only those that match your specified tags are passed on to the rest of your workflow.
Filter by Size.
Filters the current batch based on image size, so that only those files that match your specified size are passed on to the rest of your workflow.
Rename from IPTC. Renames images based on their IPTC tags.
Save as JPEG. Saves the current image as a JPEG file. (Updated on 7/21/05 to fix a few bugs)
Motion Blur. Applies Photoshop’s Motion Blur filter.
Convert to Profile. Converts the image to the chosen profile.
Change Pixel Aspect Ratio. Changes the pixel aspect ratio of the current document.
Change Bit Depth. Allows you to change the bit depth of the current image to either 8 bits/channel or 16 bits/channel.
Filter From Bit Depth. Filters the current batch of images based on bit depth. Only passes on images that match the specified bit depth, either 8- or 16-bit.
Shadow/Highlight. Executes Photoshop’s Shadow/Highlight adjustment. Requires that you activate GUI Scripting, using the new AppleScript utility located in Applications>AppleScript.

I will be adding more Photoshop commands as I get them built, and am eagerly open to suggestions for individual commands, or more complex Photoshop actions that you’d like to see developed. Please send any comments, requests, bug reports, or what-have-you’s to automator at completedigitalphotography dot com.
Photoshop CS Automator Actions http://www.completedigitalphotography.com/Features/PhotoshopForAutomator/PSCSAutomatorActions.sit
Photoshop CS2 Automator Actions http://www.completedigitalphotography.com/Features/PhotoshopForAutomator/PSCS2AutomatorActions.sit

(Please note: these actions are working just fine, but they're pretty no-frills. They don't have any range checking, to ensure that input parameter values are legal, and they don't intelligently change file formats if you introduce layers or modes that aren't supported in the image's original format. These issues should rarely, if ever, present problems, but I'll be posting newer versions soon, which should fix these issues.) http://www.completedigitalphotography.com/index.php?p=339

MACinations Aug 05

Next Article