When iPhoto 9 added facial recognition features, some people complained about this feature not being in Aperture. I'd be surprised if this doesn't make it into Aperture 3 whenever that comes out, but for now here's a workaround, using the hidden 'fingerprint' stored in Aperture's Preview files.
Notes:
Ian
| Attachment | Size | Hits | Last download |
|---|---|---|---|
| iPhoto Faces to Aperture v1.scpt | 18.05 KB | 117 | 12 min 23 sec ago |
Unfortunately, Snow Leopard doesn't seem to to add IPTC data to its database for images contained in a package such as the Aperture library. The information is still within the previews as can be confirmed when opening them with Preview.app.
Running mdls on a files within the Aperture library will not yield any IPTC data. Copying the preview from the library to the desktop and then run mdls on that file, will yield IPTC data and thus the Instruction tag, with the Aperture fingerprint.
As for now, I've modified your script to use Exiftools to extract the IPTC field, then It'll work in Snow Leopard.
Would you be willing to share the updated script? I'm interested in getting this to work in Snow Leopard.
To make it work in Snow Leopard, download the Exiftools package. It can be found here: http://www.sno.phy.queensu.ca/~phil/exiftool/.
Then update the script so the last section reads like this:
on get_ID(this_imagefile)
set this_imagefile to POSIX file this_imagefile -- in your own scripts you may need to remove this line for use with Mac-style file paths rather than the UNIX-style path that the iPhoto script returns.
set this_imagefile to this_imagefile as alias
set this_imagepath to the POSIX path of this_imagefile
if this_imagepath contains ".aplibrary" then
tell application "System Events"
set this_folder to the POSIX path of the container of this_imagefile
end tell
end if
set the scan_result to (do shell script "exiftool -fast -SpecialInstructions " & (quoted form of this_imagepath)) -- The fast option may not improve speed that much. Only when your Library is accessed over a slow network connection it may improve speed. But it won't hurt either.
if the scan_result is not "" then
set the scan_result to text from ((offset of ":" in scan_result) + 2) to -1 of the scan_result
if scan_result is "null" then set scan_result to missing value
else
set scan_result to missing value
end if
return scan_result
end get_ID
Rutger, thanks for posting your updated script.
By the way, EXIFTool is what GPS2Aperture uses to embed GPS data in the Masters - it's a wonderful tool!
Ian