Aperture batch export AppleScript

While in Australia and New Zealand, I shot a ton of photos.

Normally, my photos sit on a hard drive and no one sees them. I wanted to make sure that didn’t happen this time.

First, I grouped the photos in to folders in the Finder. Then, I created a new project in Aperture and imported all of the folders as albums. Then, I went through each folder and rated the photos. If a photo was 4 or 5 stars, I deemed it good enough for flickr.

I wrote the following AppleScript to find the albums, iterate through them, and export JPEGs of all the photos I had starred.

property basePath : “harddrive:Users:me:some_photos:”

with timeout of 600 seconds
  tell application “Aperture”
    set myProject to get project “some_project”
    set myAlbums to every album of myProject whose name starts with “NZ”
    set albumCount to count items in myAlbums
    –set myAlbums to items 16 through albumCount of myAlbums
    repeat with currentAlbum in myAlbums
      set folderName to name of currentAlbum & ” selects”
      set imageList to (every image version in currentAlbum whose main rating is greater than 3)
        tell application “Finder” to make new folder at basePath with properties {name:folderName}
      end try
      export imageList to basePath & folderName using export setting “JPEG – 50% of Original Size”
    end repeat
  end tell
end timeout

Leave a comment

Your email address will not be published. Required fields are marked *