Want more of your metadata available in Aperture?
Phil U.
Registered Users Posts: 1,330 Major grins
...such as lens info or other items? I stumbled across this thread some time ago where there was some work being done with Applescript using Exiftool to import additional metadata into Aperture. I adapted my own version which you can see lower in that thread and I will regurgitate it here:
First off, let me say that before doing this, I had done NO work in Applescript or Automator. I've done plenty in other scripting languages but in these I'm a complete newbie. This was a good exercise for me because I'd wanted to play with them but just hadn't "gotten around to it".
What I have works very much like what Allan has been doing - since it's based in part on his code. You still have to go into the scripts and select what tags you want. You still have to tell it where your library is. So on and so on. See the scripts themselves for more details on what you need to do. The bits you have to modify are right at the top.
There are two files in the download: A standalone Applescript for existing photos in the library and an Automator workflow in order to import new photos and do the custom metadata work at the same time. You can use this workflow as a basis for your own import workflow or incorporate it into an existing workflow if you have one.
I added a couple things that I wanted to have. It has the ability to write your copyright string into the original file (for new files using the Automator workflow - not for existing masters in the database) and/or into the "Copyright Notice" tag in Aperture. It will use the year from the modified date of the master inserted into the copyright string. You can configure that in the scripts.
I have the workflow also blanking out the image description in the original files. This is because Olympus writes "OLYMPUS DIGITAL CAMERA" into the image description of every file. A pet peeve of mine since if I forget to blank it out or put something else in there, my photos show up with that in the caption when I post them.
When doing the metadata, the script checks the tag group (IPTC, EXIF, etc.) and if IPTC, it tells Aperture to make an IPTC tag otherwise it makes a custom tag. EXIF is read only so I can't have it update any of those.
In my testing, this script appears to work quite well for all image types in Aperture (I've tested with JPG, PSD, ORF, versions, external edits). It always uses the master file that any version is based from (an external edit is itself a master - if you have an additional version based off that external edit, it'll use the external edit (PSD/TIFF) master file). ***Referenced files don't work, they'll have to be managed in the library.
----
HOW TO
First, you must install Exiftool if you don't have it already. http://www.sno.phy.queensu.ca/~phil/exiftool/
To update any/all existing images in your library:
Open the Applescript in Script editor. Make any necessary changes. Open Aperture and select the images you want to update. Go back to Script Editor and click "Run".
In order to be able to see what images remained in my library to process, I included the "-ExifToolVersion" tag in the script (also in the workflow). I made a smartalbum at the Library level that only looked for images where "Exif Tool Version Number" is null. Those are the images that have not been updated yet. I was able to let the script run on my entire library without issue. The only problem I had was when I was browsing around Aperture while it was running. The browsing caused Aperture to crash a couple times. Once I left it alone it ran without incident. ***Please, please, please test it on a few images first to make sure it does what you want before running on your whole library. Also make sure you have good backups first!!!
To use the workflow for importing new images:
Open the workflow in Automator. There are two Applescript steps in the workflow. Make sure you modify the necessary information in both scripts. Then you can save the workflow as a finder plug-in. I reccomend copying your photos from the memory card to a temporary location (for performance and to have that initial backup before starting to mess with the files). Select the photo files you want to import, right/control-click and select Automator/Aperture Import (or whatever you called it when you saved it) from the context menu. It'll chew through the images putting in the copyright info (unless you removed that step) then ask you where you want to import the photos (new or existing project). Don't select "Referenced" as it won't be able to do the metadata part. If doing a large set, it may take a little time before asking the import and then again afterwards before the metadata is updated.
The Aperture Import action available in Automator that I'm using for my workflow doesn't seem to want to import to any projects that are in a folder. That appears to be a bug with the provided action.
Since all of my existing projects are organized into folders, I just tell it to create a new project. that works fine then I can move that project or just the photos in it to wherever I please.
I suppose you could also just leave a project there at the root of the library all the time that you can import into if you want to.
Obligatory disclaimer: I'm not sure how it could, but if this in some way hoses your whole library, it's not my fault. Backup and test before doing anything major you might regret.
Let me know if you run into issues or if you have suggestions. Comments, praise, and snide remarks are welcome as well ;-)
You can download it here:
http://homepage.mac.com/puithove/ApertureMetadataStuff.html
First off, let me say that before doing this, I had done NO work in Applescript or Automator. I've done plenty in other scripting languages but in these I'm a complete newbie. This was a good exercise for me because I'd wanted to play with them but just hadn't "gotten around to it".
What I have works very much like what Allan has been doing - since it's based in part on his code. You still have to go into the scripts and select what tags you want. You still have to tell it where your library is. So on and so on. See the scripts themselves for more details on what you need to do. The bits you have to modify are right at the top.
There are two files in the download: A standalone Applescript for existing photos in the library and an Automator workflow in order to import new photos and do the custom metadata work at the same time. You can use this workflow as a basis for your own import workflow or incorporate it into an existing workflow if you have one.
I added a couple things that I wanted to have. It has the ability to write your copyright string into the original file (for new files using the Automator workflow - not for existing masters in the database) and/or into the "Copyright Notice" tag in Aperture. It will use the year from the modified date of the master inserted into the copyright string. You can configure that in the scripts.
I have the workflow also blanking out the image description in the original files. This is because Olympus writes "OLYMPUS DIGITAL CAMERA" into the image description of every file. A pet peeve of mine since if I forget to blank it out or put something else in there, my photos show up with that in the caption when I post them.
When doing the metadata, the script checks the tag group (IPTC, EXIF, etc.) and if IPTC, it tells Aperture to make an IPTC tag otherwise it makes a custom tag. EXIF is read only so I can't have it update any of those.
In my testing, this script appears to work quite well for all image types in Aperture (I've tested with JPG, PSD, ORF, versions, external edits). It always uses the master file that any version is based from (an external edit is itself a master - if you have an additional version based off that external edit, it'll use the external edit (PSD/TIFF) master file). ***Referenced files don't work, they'll have to be managed in the library.
----
HOW TO
First, you must install Exiftool if you don't have it already. http://www.sno.phy.queensu.ca/~phil/exiftool/
To update any/all existing images in your library:
Open the Applescript in Script editor. Make any necessary changes. Open Aperture and select the images you want to update. Go back to Script Editor and click "Run".
In order to be able to see what images remained in my library to process, I included the "-ExifToolVersion" tag in the script (also in the workflow). I made a smartalbum at the Library level that only looked for images where "Exif Tool Version Number" is null. Those are the images that have not been updated yet. I was able to let the script run on my entire library without issue. The only problem I had was when I was browsing around Aperture while it was running. The browsing caused Aperture to crash a couple times. Once I left it alone it ran without incident. ***Please, please, please test it on a few images first to make sure it does what you want before running on your whole library. Also make sure you have good backups first!!!
To use the workflow for importing new images:
Open the workflow in Automator. There are two Applescript steps in the workflow. Make sure you modify the necessary information in both scripts. Then you can save the workflow as a finder plug-in. I reccomend copying your photos from the memory card to a temporary location (for performance and to have that initial backup before starting to mess with the files). Select the photo files you want to import, right/control-click and select Automator/Aperture Import (or whatever you called it when you saved it) from the context menu. It'll chew through the images putting in the copyright info (unless you removed that step) then ask you where you want to import the photos (new or existing project). Don't select "Referenced" as it won't be able to do the metadata part. If doing a large set, it may take a little time before asking the import and then again afterwards before the metadata is updated.
The Aperture Import action available in Automator that I'm using for my workflow doesn't seem to want to import to any projects that are in a folder. That appears to be a bug with the provided action.
Since all of my existing projects are organized into folders, I just tell it to create a new project. that works fine then I can move that project or just the photos in it to wherever I please.
I suppose you could also just leave a project there at the root of the library all the time that you can import into if you want to.
Obligatory disclaimer: I'm not sure how it could, but if this in some way hoses your whole library, it's not my fault. Backup and test before doing anything major you might regret.
Let me know if you run into issues or if you have suggestions. Comments, praise, and snide remarks are welcome as well ;-)
You can download it here:
http://homepage.mac.com/puithove/ApertureMetadataStuff.html
0