Aperture 3 AppleScript details

Last night and earlier today I was able to find the time to explore Aperture 3’s new AppleScript related features and I’m one happy user. I’m not sure which makes me happier: new functionality or the documentation Apple provided.

Examples!
Aperture 3 AppleScript dictionary excerpt

Aperture 3 AppleScript dictionary excerpt

Above is a screenshot of a portion of Aperture 3’s dictionary. Notice the example! This is the first time I’ve seen an example script in an application’s AppleScript dictionary. The other nice addition is the text “Example Script” is a hyperlink that opens the script editor with the example script in a script window. No need to copy and paste the example script out of the dictionary and into the script editor. Having example scripts and snippets for each command and a few classes is huge as it helps to educate the scripter on proper usage. I wish every application had examples in its dictionary as it would save so much time and frustration.

New classes, commands, and much more!
I think the dictionary does a good job explaining each item in the dictionary so I’ll just list some of the more important additions to the dictionary. I encourage everyone to check the dictionary out and explore it as there may be some stuff in it you didn’t realize existed and might be able to help in your automation efforts.

New Classes
1. Image Adjustment Preset
2. Trash-folder
3. Container
4. Image Version - this class isn’t new, but there are a few properties new to 3.0 that are worth mentioning: color label, latitude, and longitude.

New Commands
1. Apply Image Adjustment - this command applies an image adjustment preset to an image version.
2. Reset All Image Adjustments - removes all image adjustments from an image version.
3. Refresh Metadata - I believe this command does the same thing as Metadata -> Update from Master command found in the GUI.
4. Restore - moves containers out of the Aperture Trash and into the Library.

Enumerations
1. Color Labels - similar to color labels found in the Finder

Events
1. importActionForVersions - read on for more information on this event.

Import Actions brick
Aperture 3 Import Actions

This might be my favorite feature in all of Aperture 3 as it essentially provides Aperture users with what I would call “intelligent import”. Used in conjunction with the importActionForVersions event, Aperture now has the ability to perform actions on image versions at the end of an import based on particular criteria. Say I want to add a particular adjustment preset to all image versions whose ISO is greater than ISO 400. Or maybe I like to organize my images by date. Rather than make individual imports per date or organize the images in projects manually, this brick allows me to automate that process. Or perhaps you would like to import images you just took, quickly apply an adjustment preset to all the images, and export all the newly imported images out as versions so you can get them to a client. I’m sure just about anything is possible with this brick.

Documentation
With the release of Aperture 3, Apple also provided documentation on Aperture 3’s AppleScript capabilities. I think this is the first time Apple has provided documentation for an application’s AppleScript dictionary outside of the actual dictionary, assuming you consider the dictionary documentation. I almost fell off my chair when I found discovered this. Hopefully Apple releases similar documentation for its other applications in the near future.

You can download the PDF at apple.com/aperture/resource or directly here.

Granted most of the document’s contents are straight from the dictionary but there is more there than what the dictionary provides. For example, the appendix contains a containment & inheritance diagram as well as mapping tables for EXIF, IPTC, and the “other” metadata fields. The tables map between field names as they appear in AppleScript to field names as they appear in the application’s GUI. The document also contains example scripts and special notes on usage.