Launching a Photoshop Automation From Aperture

by Ben Long

In this posting of a few months ago, I showed how you can create an automated Aperture/Photoshop printing process using a Finder Folder Action. The idea was that, if you wanted to print using Photoshop - either because of its color engine, or because you want access to your printer's driver color (something Aperture doesn't allow) - then this method would provide a simple automated process that would let you launch a Photoshop-based printing process by simply exporting the image to be printed from Aperture.

The glue that ties the two applications together, and makes the whole procedure work, is a Folder Action. A Folder Action is a standard Finder feature that lets you attach an AppleScript to a folder. Any image that's placed in that folder will trigger the AppleScript, and if the script is written properly, its functions will be applied to that image.

You can use this same mechanism to automate other Photoshop actions using Automator. For example, say you have an Aperture project that contains a series of images that you want to merge into an HDR image, or perhaps there's a Photoshop filter that you want to apply to an image, or maybe you like Photoshop's built-in web gallery features better than Aperture's. You can achieve any of these operations by creating a script that performs the actions, and then attaching that script as a Folder Action to a folder. When you want to apply those effects to an image in your Aperture library, simply export the image from Aperture into the folder. The Folder Action will automatically process the image.

In this way, you have a simple, automated process for applying Photoshop operations to any image in your Aperture library.

Now, that first step that I described - the one that says "create a script that performs these actions - that initial process might be somewhat flummoxing, as it requires you to understand a fair amount of the AppleScript scripting language, as well as have a familiarty with Photoshop's AppleScript dictionary. Because scripting is not something that most Mac users are comfortable with, Apple created Automator a very powerful application that's bundled with every Mac, and which allows you to create complex scripts using a simple drag-and-drop process. With Automator, you can easily create "workflows" that take control of multiple applications and perform very complex operations. What's more, these workflows can be attached to folders as Folder Actions, meaning you can trigger them by simply dropping an image into a folder.

By default, Automator doesn't include any facility for creating workflows that control Photoshop. However, if you download my free Photoshop Action Pack you'll get a set of 87 Automator actions that allow you to control just about every feature of Photoshop. I haven't yet updated the collection for the latest CS3 features, but you can still execute almost all of the Photoshop operations that you'd ever want to perform using Photoshop CS, CS2, or CS3 on either an Intel or PowerPC-based Mac.

The Action Pack includes a 70 + page manual that provides detailed tutorials and examples, as well as an introduction to using Automator, so you should find it fairly easy to get up to speed. Note, though, that most of the queries that I receive about the Action Pack stem from the fact that most people don't read the first five pages of the included manual. So, if you find yourself a little confused about how the Action Pack works, ten minutes with the documentation should have you up and running very quickly.

Why would you use Automator to script Photoshop when Photoshop has its own built-in Actions palette? There are a few reasons. First, Photoshop's built-in actions don't allow you to perform any logical operations, while my Action Pack does. So, for example, you can create a workflow that processes all of the grayscale images in a batch using one set of operations, and all the RGB images using another. Or, you can resize portrait images to a different size than landscape images. The Action Pack also lets you script multiple applications from within a single workflow. So, for example, you can create an automation that processes images in Photoshop, then automatically uploads them to an FTP server, and then burns the whole batch to a DVD.

Finally, you can save Automator workflows as Folder Actions, and attach them to a folder. When you export an batch of images from Aperture into that folder, each image will be processed using the attached workflow.

All-in-all, if you have any desire to automate or script Photoshop, Automator and the Photoshop Action Pack provide you with more power and easier workflow creation than Photoshop's Actions alone.

To return to the previous examples, if you want to create an automatic procedure for batch processing HDR merges from within Aperture, you would first install the Photoshop Action Pack and create a workflow that uses the Merge to HDR action.


Attach this workflow to a folder as a Folder Action, and any images you export into the folder will get merged into an HDR. The Photoshop Action Pack manual has detailed instructions on using this Merge to HDR feature.

If there's a Photoshop feature that you want to script that's not supported by the Action Pack, you can use the Do Action action to trigger any Photoshop Action that you've created. That's a little confusing, I know, so let me phrase it a different way. In the Photoshop Action Pack you'll find an action called Do Action. It triggers a Photoshop Action - that is, an action you've created with Photoshop's internal Actions palette.

For example, the Action Pack does not include any way to apply the Solarize filter. But, I can easily create an Action within Photoshop that applies a Solarize filter. I can then trigger that Solarize Action from my Automator workflow using Do Action:


Detailed explanations of the Open and Render actions are provided in the Photoshop Action Pack documentation PDF.

With the Photoshop Action Pack, you can create automated Photoshop operations that can be triggered from within Aperture simply by using the Export Versions or Export Masters command.