Hierarchical Keywords Expansion Using AppleScript in Aperture 3
Aperture 3 supports hierarchical keywords and I love them. Taking a little time up front to organize your keywords hierarchically speeds up your workflow. Tagging images is boring, albeit necessary to help people (and search engines) find your photos.
Hierarchical Keywords in a nutshell
Understanding hierarchical keywords is best explained with an example. A few months ago I was in Austin, Texas and shot a bunch of photos. I added the city “Austin” to my keywords as shown here:
When assigning keywords, I explicitly assigned only the “Austin” keyword. The rest of keywords in the hierarchy — “Texas”, “United States”, “North America”, and “Place” — were implicitly applied by Aperture.
Now, when I search for photos with the keyword “Texas”, the results include all photos from “Austin”. And “Dallas”, and “Houston”, and so on. Aperture understands the keyword hierarchy and shows me the photos I expect to see.
Location hierarchies are intuitive for most people. I also have hierarchies for all sorts of subjects and descriptions. Examples include Occupations, Nature, Architectural Features, Human Emotions, and Immediate Family.
So far, so good. All sunshine and double rainbows. Fewer keywords to assign, a faster workflow. However…
The export caveat
Aperture fully understands hierarchical keywords. The important words in that last sentence are Aperture understands. Other applications do not. When a version or original is exported, only the explicitly assigned to the photo are included in the exported image. Put another way, only the tags in the Keywords metadata field will be in your exported image. In the example below, the keywords are limited to “Austin”, “Bridges”, “Landscape”, “Outdoor”, “River”, and “Rocks”.
This is a problem for images shared on photography sites such as 500px or Flickr. The additional keywords increase the visibility of your photos and improve the changes of someone finding your photos. In my example, anyone searching for “Texas” photos will not find my shot. Not good.
So what to do? Manually assigning all keywords in the hierarchy is more time consuming. Lifting and stamping the keywords is an option, although you still spend the up front time applying loads of keywords to the initial image. For one or two images, that may be acceptable, but it doesn't scale to larger projects.
The best of both worlds
I didn't want to give up on using hierarchical keywords. The keyword step of my workflow is very streamlined. So, I wrote an AppleScript to expand the keywords when I need it. It's called… wait for it… Expand Hierarchical Keywords. Ok, so I don't have a future in marketing.
The script walks through the keywords assigned to an image and “flattens” them to include the parents as explicitly assigned keywords. Select one or more photos to expand, run the script, and you're set. After running the script against my bridge photo above I have a wider set of keywords now.
You can see the script in action here:
The script offers a few customizations:
- Turn on/off the creation of a new version for expanding keywords (default is on)
- Specify a keyword blacklist for keywords you do not want applied (in my example, “Place” isn't a very meaningful keyword to apply, so that a candidate for the blacklist)
- Flag the image(s) with expanded keywords (default, no flag)
- Set a color label to the image with expanded keywords (default, no change to the color label)
I personally keep version creation turned on. The versions with the expanded keywords are transitory. Once I've exported and shared to online portfolios, those versions are deleted. The latter two customizations make it easier to locate the images modified by the script.
This does add a step in my workflow, however only for images that I post to photography sites. Yet it's automated, quick, and meshes well with further workflow steps. When the script completes, the images with the expanded keywords are automatically selected ready for the next step in your workflow.
EDITOR'S NOTE: If you haven't used an AppleScript in Aperture before, you'll need to enable some preferences in the AppleScript Editor for the script menu to show up. You can download the free instructions for all the scripts sold on ApertureExpert here, which will tell you everything you need to know to install.