NZMac.com - Supporting the New Zealand Mac community : Tuesday, 07 October 2008
Using Automator to batch convert images Print
Written by Darryn Lowe   
Saturday, 28 June 2008

ImageOne of the most powerful features of Mac OS X since Tiger has been Automator, and yet it is also one of the most under utilised features of Mac OS X. In this article I will show you how to perform a batch conversion of images using Automator and Quartz Composer. It is extremely simple and hopefully will get you more interested in using this powerful application to make your life easier.

Note that this workflow will not run under Tiger on account of it using Quartz Composer, which is not part of Tiger.

Automator is found in the Applications folder so open it up. The first screen you will see is a Project style window...

Project window

Choose "Files & Folders" and set the second drop down box to "Ask for files & folders when my workflow runs" then click "Choose".

You'll see there is already an Automator action added...

First action

We need to make a slight change to the default so change the "Type" drop down to read "Files and Folders". Also tick the "Allow Multiple Selection" box beside it. What this does is allows you to choose either a file or an entire folder as your source.

You'll see on the left there are two columns. The first is the "Library" column which lets you choose from a number of Automator actions by category. This "Library" view can be set to sort actions by application from the "View / Arrange Actions By" menu.

In the Library column click on "Photos" and you'll see the second column change accordingly. These are only the actions related to the Photos category. Select the "Apply Quartz Composition Filter to Image Files" action by either dragging it or double clicking it. You will see a dialog box come up:

Warning

Click "Add" and it will add another action whereby it will copy the files to a different location so that the original files are preserved.

ActionsIn the "Copy Finder Items" action change the "To" drop down box to the location that you want the files to be worked on. Also tick the "Replacing existing files" box beside it to overwrite files in this directory or not, depending on whether you want this course of action.

One thing to note with this action, if you choose a folder to convert it will actually make a folder in the destination location just to keep things a bit more tidy which is nice.

In the "Apply Quartz Composition Filter to Image Files" action click on "Options":

You'll notice two tick boxes here but one will be grayed out. Tick the "Show this action when the workflow runs" box. This will bring up a dialog box that will allow you to choose what Quartz Composition Filter you want to apply. If you don't, whatever composition you have chosen from the drop down menu (currently set to "Sepia") will be applied...and only that one.

This workflow isn't going to work though at the moment. It will run but when it gets to the "Apply Quartz Composition Filter to Image Files" action it will do nothing to the images and close.

There is a step that needs to be added between "Copy Finder Items" and "Apply Quartz Composition Filter to Image Files". So under the "Library" column click on "Files & Folders" and once again you'll see the second column change accordingly. Drag the "Get Selected Items" action over into the workflow window in between "Copy Finder Items" and "Apply Quartz Composition Filter to Image Files":

So what's going to happen now when you run it is this:

  • Workflow will run
  • It will ask you for the files or folders that you want to convert
  • It will copy these files or folders to the destination you have selected
  • It will select those files or folders once copied
  • It will ask you for the Quartz composition you want applied to those files or folders
  • It will apply the selected composition to the files or folders
  • Workflow will quit

One thing to notice. See how in-between each action there is an arrow that goes into a circle like so...

Arrow

This shows that each of the actions are connected and will be run sequentially. If this is not showing then the workflow will quit without performing the next action. If this doesn't show up right-click (Control-click) on the last entry's title and select "Accept Input" from the menu and it will merge with the action above it.

Now save the workflow to where ever you want. I recommend saving it as an "Application" as it will become standalone instead of a "Workflow" which will fire up Automator every time.

Comments (2)add comment

Philip Roy said: June 28, 2008   Votes: +0

I mentioned this cool freeware tool to Darryn as he was developing this article....

Photo Drop (http://www.aramk.net/photodrop)
 
report abuse
vote down
vote up

lowededwookie said: July 04, 2008 | url    Votes: +0

PhotoDrop and this Automator workflow work beautifully together.

The Automator workflow performs a number of effects and filters whereas Photo Drop only does resizing and file conversions.

One thing I need to clarify is that you need to select all the files in the folder in order to run the conversion otherwise the workflow tries to apply the filters to the folder which isn't going to work. Sorry if you tried to select a folder and the workflow quit without doing anything. I think 10.5.3 might have changed things a bit because the workflow used to work properly under 10.5.2.
 
report abuse
vote down
vote up

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy
Last Updated ( Saturday, 28 June 2008 )
 
Advertisement
Site developed by Bluengrey.com :: Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design