AppleScript to the rescue in Aperture

I recently cam et the conclusion that my workflow in Aperture was flawed and decided that I wanted to convert several hundred of my albums to projects but that I did not want to change the structure of my library in any other way. After some fiddling around with AppleScript I acme up with the following short script to do the job. You have to remember to select all the images in the album you want to convert first and you still have to do one album at a time but it beats the manual alternative.

tell application "Aperture"
    set imgSel to (get selection)
    if imgSel is {} then
        error "Please select an image."
    else
        set aName to name of parent of item 1 of imgSel
        set fName to name of parent of parent of item 1 of imgSel
        tell folder fName
            make new project with properties {name:aName}
            repeat with i from 1 to count of imgSel
                move item i of imgSel to project (aName)
            end repeat
            delete album aName
        end tell
    end if
end tell

One Comment

  1. Peter
    Posted 13/5/10 at 10:52 | Permalink

    Here is a refinement to this script that does not require you to select all the images in an Album (just one – which usually happens by default when you select an Album).

    tell application "Aperture"
        set myAlbum to parent of item 1 of (get selection)
        set pName to name of myAlbum
        set fName to name of parent of myAlbum
        set myVersions to every image version of myAlbum
        tell folder fName
            make new project with properties {name:pName}
            repeat with i from 1 to count of myVersions
                move item i of myVersions to project (pName)
            end repeat
            delete album pName
        end tell
    end tell
    

Post a Comment

Your email is never shared. Required fields are marked *

*
*