Aperture AppleScript – Export & Restore Metadata
Aperture can export *some* of the metadata associated with your images quickly & easily. It can’t, however, reimport that data nor can it export all of the metadata from your images.
Hence these AppleScripts.
The first one will export the metadata for all selected file. It will save the data to a text file with a header row so that you can determine what data corresponds to what column (easy import into database or spreadsheet). It will export EXIF, IPTC and some custom metadata. You can customize the order and determine what fields are exported by editing the ‘theIPTC’ variable list.
export-metadata-to-file-06scpt1
The second script will read an export file (with header) and apply metadata to images based on their name.
restore-metadata-from-file-06scpt1
Technorati Tags: Aperture, AppleScript

This post has 18 comments
April 7th, 2009
Hello, your script seems exaclty what I am currently looking for. But it’s not clear how to install it inside Aperture so that it can export custom metadata from within the application. Thank you very much for clarification.
April 8th, 2009
You can run the script from within Script Editor or from the Script menu item. You can enable the script menu by opening the AppleScript Utility (/Applications/AppleScript/) and checking ‘Show Script menu in menu bar’ – this will show a little scroll icon in the menu bar. Then open Aperture and activate the Scripts (scroll) menu and choose Open Scripts Folder > Open Aperture Scripts Folder. A folder will open in Finder and any AppleScript you put in there will show in the Scripts menu.
April 8th, 2009
Thank you for your prompt reply. Unfortunately, this has corrupted the chosen file and I had to remove it from Aperture, then find it back from backups and re-edit metadata… I really don’t understand what has happened.
April 11th, 2009
Ouch! The script should not be able to corrupt a master file. It only reads from and writes to the Aperture database. Perhaps your Aperture database is damaged. You can rebuild your Library by holding Command-Option when you launch Aperture. Sometimes that can really help when things aren’t quite working right.
October 22nd, 2009
Hi.
Thanks for this – it could be very useful….
However, having tried the export script it doesn’t seem to do anything after the images in a project are chosen. No text file I can find is exported.
Could this be relevant:
set srcFile to choose file
– set srcFile to alias “BG_MBP2:Users:brett:Desktop:Aperture-Metadata.txt”
Is this specific do your desktop and does it need to be changed?
Thanks, Tim
February 1st, 2010
Thank you very much…
June 8th, 2010
Hi Brett,
I’m tring to manage ten thousands plant picture in aperture 3.0.3. It’s really useful to add custom field in metadata that helps me to do classification. But it bothers me that exporting metadata doesn’t work in my case. Whatever I use your script or menu in aperture, The output file(.txt or .csv) only have data in two columns, include the version name and another are meaningless 0,1, while the others is blank with a header. Would you show me how to solve this problem?
BTW, I shut in RAW and transfer them into exif-jpg in DPP(CANON).
And I love your restoring scripts. Is that means I can input the infomation in spreadsheet then import it to image?
June 18th, 2010
I haven’t tested my metadata export scripts under Aperture 3 yet. As some metadata field names have changed, I suspect that the export may fail – or as you are seeing generate bad output. Unfortunately I never did get around to making those scripts as robust as I had intended.
The reason I wrote those scripts was to get custom data out of Aperture so that I could back it up in a more portable format- and get that data back. I have since moved away from that strategy and am now using Chronosync to make a small, targeted backup of my Libraries (excluding the big stuff like thumbnails, masters, and previews).
August 6th, 2010
Hi Brett,
Incredibly useful script for getting the metadata that Aperture doesn’t export (like lens model) to JPegs. I’m completely new to Applescript and wondered if you mind telling me how you script could be altered to output to individual files. For example create “image1.txt” for “image1″ in the library and so on. Many thanks for a brilliant place to start.
August 12th, 2010
Ken- Your email address bounced, but I had said that I’d like to try to build the script that you’ve asked about. I’ll see what I can do… stay tuned
October 30th, 2010
Hi Brett,
I’m using Aperture 3.1 and feel that your script could be very useful for the following task, though I think I’m missing a piece of the puzzle.
I want to create custom fields within Aperture which correspond to the Alamy.com-specific metadata fields. Although Alamy has a web based keyword tool, I would rather stay within Aperture to type up the data they need and export a csv. Alamy will accept the spreadsheet in lieu of using their online tool.
I could create the custom fields necessary in Aperture, but I would need to be able to output them as a CSV with a specific column order of standard IPTC fields and Alamy specific fields.
I’m not sure how to operate this script. It appears in my desktop script menu bar. It will ask me to choose a file, though what type it needs I’m not sure. It doesn’t proceed beyond that.
You mention that you haven’t tested it with Aperture 3, so that could be the problem. I hope that you have the interest to continue its development. I’ve been hunting high and low for an effective way of exporting all Aperture data fields, and I’ve found no tool for the job. Your script is as close as I have come. No one else is working on this as far as I can tell.
I can share the Alamy spreadsheet template if you are curious. Thanks so much.
November 1st, 2010
I updated one of this script’s derivatives recently. The new version will export the metadata into a file per image. Email me the file and I’ll see if I can hack something together for you.
March 27th, 2011
Hi Brett,
Apologies for the long delay in responding. I somehow managed to crap out my Aperture library, lost an awful lot of metadata and got disheartened by the debacle for a while. I’ve got myself back up and running and noticed you mentioned you’ve done some work on the script. Did you manage to get a version with individual output files working?
One comment. I downloaded the version of the script at the top of this page and it requires you to have created the text file before it will work i.e. the “Choose” button is greyed out until you actually click on an existing file which it then overwrites. Is this by design?
Cheers,
Ken
March 31st, 2011
Just a brief note to thank Brett for emailing me a version of the script that extracts the data to individual text files. Works perfectly and can’t thank you enough for the work.
Cheers,
Ken
January 31st, 2012
Hi Brett!
I am using your script to later create a table and points in a GIS. Unfortunately aperture’s export metadata puts the geographical coordinates in a format that I cannot get my GIS applications to accept. The coordinates need to be a number with a decimal and that’s what your script outputs. The problem I am having with your script is that it takes so long. I am planning to leave the script running all night to go through 900 images. My question is why it takes so long vs apertures export metadata which works very quickly? Can it be sped up?
Otherwise, thanks for providing a script which makes my workflow possible (albeit slowly).
February 4th, 2012
@Scott
Scott-
Unfortunately, most of the slowness of the script is due to AppleScript’s overhead. I generally try to optimize things where I can, but sometimes that simply doesn’t gain you much.
If you only wanted to work with a partial list of the Aperture metadata then things could possibly be sped up quite a bit.
February 4th, 2012
Hi, since this post dates quite a bit, I just wanted to add a short update to to say that I have successfully used these scripts with Aperture 3.2.2.
I tweaked the export script to only export the version name, headline and captions, then I exported the metadata to a text file, imported that in Excel to send it over to my caption writer. When the captions were done, I exported from Excel a tab-delimited text file which was restored back to Aperture.
For those like me who have accented characters in their metadata fields, make sure that you restore from a text file which has a MacRoman file encoding. This can easily be saved with Textmate or BBedit.
Thanks to Brett for keeping these scripts available. They saved me a lot of time!
February 4th, 2012
You’re very welcome! I’m glad you found these scripts helpful. I’m also happy to hear that you’ve been able to modify it to suit your particular needs.
One of the great things about making an app AppleScriptable is that it allows the users to use the app to do exactly what they want. I wish more developers made their apps AppleScriptable!