How often are you faced with a regular metadata manipulation that your favourite image processing application just does not offer? Think of filling in your copyright data in one go, correcting your camera’s time settings for a number of images or setting your home geotags.
Put the power of Phil Harvey’s excellent ExifTool and Apple’s Automator together and you will have replaced many previously tedious tasks with a simple action.
Metadata Manipulator
ExifTool is the Swiss army knife of metadata modifications, reliable and versatile, supporting all possible formats and standards. But the downturn is that it is a Perl library that offers only command line comfort, and not everybody is a programmer. There is a Windows-based GUI, but there is also the possibility to integrate the library with Apple’s Automator that ships with MacOS since 10.4.
I will show you a few actions that I use quite regularly because they are much faster or offer possibilities that my image processing and geotagging apps do not have. Note that those actions will work on most image types that support EXIF and IPTC tags. Please refer to Phil Harvey’s site for details.
ExifTool operations are lossless: they modify the metadata, not the image quality.
Setup
But first, let us gear up our Mac with the ExifTool. Installation is simple: download the DMG package from Phil’s website and run the installer. Remember, it is a command line tool, so it will not put a program icon in your applications folder.
Now launch the Automator which sits in the root directory of your applications folder (“Automator.app”).
From the welcome screen select “Photos & Images”, the future default location of the image files (“Get content from”) and the kind of interaction you would like to see. I chose “Ask for image files when my workflow runs” as it gives you a lot of flexibility.
The “Ask for Finder Items” action now appears in the column to the right. You may configure it to your needs – I recommend to change the options to “Files and Folders” and “Allow Multiple Selections”.

The Automator window consists of two areas: to the left, there are the available action templates. The right column contains the individual action steps we are currently working on.
This is the general starting point for the actions described below.
Write EXIF Creation Date Into IPTC
For our first ExifTool action we assume that we want to transfer the EXIF creation date into the IPTC creation date header. (This is just an example for how to build a workflow – for more specific timestamp modifications please refer to my post “Timestamps and Timezones“.)
Add “Run Shell Script” from the action template column in the middle and drag it to the right, just below our first entry.
In the text box enter the following script:
for f in "$@"
do
exiftool -overwrite_original '-IPTC:DateCreated<EXIF:CreateDate' "$f"
done
(Be careful when copying and pasting this code to remove any line breaks that may occur in the exiftool statement! There should be only the one before the “done” line. Note that Macs require single quotes in the parameters. For further explanation of ExifTool parameters, please refer to Phil’s website.)
This is all you need to complete the Automator action. However, if you have Growl installed, you can set Automator up to notify you when the job is done.
Now all that is left is saving the Automator action. I suggest saving it as an application:
You can run the action just like any other application. At first, it will ask you for the source destination of your image files. Please note that the script will overwrite the source files at the location! Make sure that your first run is on copies rather than your valuable originals.

Run the Automator action like any other application. A dialog window will ask you for the location of your image files.
When you click the “Choose” button the action will set the IPTC creation date of the selected files (or all files in the selected folders) to its EXIF value. Once it has finished, the Growl notification will appear.
Write Lens Make And Aperture
I sometimes like to do a field trip using my Lensbaby Composer lens. The fascination of this accessory lies in its simplicity and the negation of the “exact” reproduction ideal other lenses pursue. Lensbaby aperture is created by a flat metal ring that you place into the lens with a magnetic pin – it is really a very basic construction.
The simple mechanical construction leaves no footprint in the camera-generated EXIF data. Neither make nor focal length or aperture will show up. So, in order to recall which settings I used, I wrote another ExifTool-based Automator action:
for f in "$@"
do
exiftool -overwrite_original -Lens='Lensbaby Composer 50mm F2-22'
-ApertureValue='4' -FocalLength='50' "$f"
done
(If you want to use this code in your own action, do not forget to remove the line breaks from the exiftool statement!)
This sets the lens make to “Lensbaby Composer 50mm F2-22″, the focal lenght to 50mm and the aperture value to F4.

This Automator action inserts Lensbaby Composer's make, focal length and aperture into the file's EXIF header.
At the beginning of the Automator workflow, I added a dialog box action (“Ask for Confirmation”) which announces what is about to happen. This is quite helpful when you use a number of scripts regularly.
After running the action on my images, the EXIF tab reveals that they are now correctly marked.
Write Recurring Geotags
Writing geotags into your travel images is usually a task for a geotagging application: using a GPS logfile or a dynamic map, you may set the location coordinates for individual shots.
However, you may often shoot images at the same location (e.g. an available light session from your tripod, press pictures from town hall, snapshots of your kids at home etc.). Then, inserting coordinates individually is not really worth the hassle. It is much more convenient to have an Automator app for each recurring location.
A simple ExifTool statement can make your life easier:
for f in "$@"
do
exiftool -overwrite_original -n -GPSLatitude='38.89767132073924' -GPSLatitudeRef='N'
-GPSLongitude='-77.03655123710632' -GPSLongitudeRef='W'
-GPSAltitude='20' -GPSAltitudeRef='0' "$f"
done
(Do not forget to remove the line breaks from the exiftool statement!)
Replace the coordinates with your shooting location (unless it actually was the White House). Do not forget to indicate the N/S and W/E reference values or you might end up on the wrong hemisphere. The altitude reference should remain 0, unless you have an underwater base that you frequent for your shootings. If you are uncertain about those values, look them up at my SMC Live Map.
Write Copyright Information
If your image processing application does not support inserting your full credentials automatically, you may use the following ExifTool statement:
for f in "$@"
do
exiftool -Artist='John Doe' -Copyright='(c) John Doe 2009, all rights reserved'
-By-line='John Doe' -By-lineTitle='Freelance Photographer' -Credit='John Doe Photography'
-Source='The Big Photography Network' -Contact='John Doe, john@doe-photography.com' "$f"
done
(Do not forget to remove the line breaks from the exiftool statement! Have I mentioned this before?)
Please refer to Phil’s website, the Associated Press’s code page or the IPTC Photo Metadata site for more details.
Adjust EXIF Time Settings
If the camera’s clock is not set correctly you may want to adjust the time stamp it left in the EXIF header. Here is an example how you can do this using the ExifTool:
for f in "$@"
do
exiftool '-DateTimeOriginal+=0:25:0' "$f"
done
This statement adds 25 minutes to the “created” time stamp in the EXIF header of the image.
A good explanation of time modifications can be found on Phil’s website.
Reading All Metadata
If you want to find out about all of the metadata information stored inside your image, you may let ExifTool create a text file with this information that is stored alongside the image:
for f in "$@"
do
exiftool -n -g1 -w %d%f_tags.txt "$f"
done
Further Reference
- Download site for Automator actions at Apple.com
Updates
- March 18th, 2009: added “Reading All Metadata” section and slightly modified ExifTool statements for increased performance
- March 24th, 2009: modified statements with single quotes; added lossless modifications hint and reference to “Timestamps and Timezones” post and SMC Live Map
Tags: Automator, ExifTool, Geotagging, Mac, Metadata, Software








This is very interesting info just what I need especially as I have just got a lensbaby Thank you
One question if you don’t mind its a bit of a dumb one sorry
Where can I get a pop up window like yours showing more info
Thanks again
Graham
Hi Graham,
in Preview, just press Cmd+i while an image is open or use the menu (under “tools” you will find the “show information” entry).
Hope that answers your question.
Klaus
Hi,
You have done a fantastic tool, I no nothing about scripting, but your example is exactly what I was looking for, I’m a photograph, and I use a lot of manuals lenses, and I was looking for a loooooong time your trick of the “Write Lens Make And Aperture”
Will it be possible to add a dialog box with text input fields like this :
Lens : ………
Focal length : ………
Aperture : ……….
and then the program write in the EXIF the value entered before !
like this, you don’t have to create a Automator droplet for each combinaison of Lens/Aperture used
can you tell me how to add such feature in the automator script ?
Thank you very much for your work
Best regards
Laurent
Hi Laurent,
thank you for your comment. Unfortunately, I do not know enough about Apple Script to help you out. As a matter of fact, I would be glad if someone came up with a solution to this, as it would be quite useful for most of the other ExifTool operations described in my blog (e.g. to set timezones).
Any contributions are greatly appreciated!
Klaus
Hi,
well after looking a bit, I found a great way, not perfect, but here it is :
After loading the file, ask Automator to do an Applescript script :
on run {input, parameters}
set r to text returned of (display dialog “Lens parameter :” default answer “{\”Lens\”,\”Focal\”,\”Aperture\”}”)
set r to run script r
return r & input
end run
Than the Shell script :
var1=”$1″
var2=”$2″
var3=”$3″
shift 3
for f in “$@”
do
exiftool -overwrite_original -Lens=”$var1″ -FocalLength=”$var2″ -ApertureValue=”$var3″ -FNumber=”$var3″ “$f”
done
That’s all
Great no !!
Hi
You have a nice walkthrough here, though I keep finding myself stuck. I’m trying to add the lens type, and have done what you were doing with the lensbaby, but simply missing the focal length and aperture parts out. In the run script shell itself I’m using:
for f in “$@”
do
exiftool -overwrite_original -Lens=’70.0-300.0 mm f/4.5-5.6′ “$f”
done
The automator runs fine, but there is no change in the EXIF data. Is it blindly obvious what I’ve done wrong?
Any help would be brilliant!
Seb
Please ignore the previous comment, embarrassingly I had failed to change the pass input to ‘as argument’. A ‘nice’ guide has become a ‘wonderful’ guide :D.
Many thanks!
[...] wyżej napisał – jakiś EXIF-Tool + Automator. Poczytaj, może znajdziesz jakieś ciekawe info ExifTool and the Automator | studio.messlinger.com Komputer: MacBook Pro 15.4-inch 2,4 GHz Telefon: iPhone 3G 8GB -> Kanał [...]