11 Replies Latest reply: Oct 31, 2006 12:28 PM by KeithFN
tidysteve Level 4 Level 4 (2,975 points)
is anyone aware of a way to batch export versions to a folder that will maintain the folder/project structure from Aperture ???

PMG5 Dual 2.0 4GB RAM - X800XT Dual 23" Cinema Displays, Mac OS X (10.4.6), PBG4 12" 1.5 1.25GB RAM
  • Gregory Rivers Level 2 Level 2 (450 points)
    it would have to be scripted

    while the Automator allows exporting, it doesn't allow walking through folders/projects to export.
  • tidysteve Level 4 Level 4 (2,975 points)
    so a combination of Automator and AppleScript would accomplish what I want to do ...

    ok ... that is what I figured ...

    i submitted it as a feature request as well ...

    thanks Gregory ...
  • applebeee Level 1 Level 1 (0 points)
    bump!
  • ramonr Level 1 Level 1 (5 points)
    try the following

    tell application "Finder"
    set location_1 to (choose folder with prompt "Choose a folder to export into") as text
    end tell

    tell application "Aperture"
    set x to name of every project
    choose from list x with prompt "Choose a project to export"
    set theP to item 1 of result
    tell application "Finder" to make new folder at alias location_1 with properties {name:theP}
    tell project theP
    set initflist to every subfolder
    set initalist to every album
    if initflist is equal to {} then
    processAlbums(initalist, location_1 & theP) of me
    else
    if initalist is not equal to {} then
    processAlbums(initalist, location_1 & theP) of me
    end if
    processSfolders(initflist, (location_1 & theP)) of me
    end if
    end tell
    end tell

    on processAlbums(alist, apath)
    tell application "Aperture"
    repeat with a in alist
    tell a
    set theimages to every image version as list
    set thename to name of a
    tell application "Finder"
    if not (exists folder thename in alias apath) then
    make new folder at alias apath with properties {name:thename}
    end if
    set destination to apath & ":" & thename & ":"
    end tell
    with timeout of 6000 seconds
    tell a
    set settings to "JPEG - Original Size"
    export theimages using settings to alias destination
    end tell
    end timeout
    end tell
    end repeat
    end tell
    end processAlbums

    on processSfolders(flist, fpath)
    tell application "Aperture"
    repeat with a in flist
    set thename to name of a
    tell application "Finder"
    if not (exists folder thename in alias fpath) then
    make new folder at alias fpath with properties {name:thename}
    end if
    end tell
    tell a
    set sAlist to every album
    set sflist to every subfolder
    if sflist is equal to {} then
    processAlbums(sAlist, fpath & ":" & thename) of me
    else
    if sAlist is not equal to {} then
    processAlbums(sAlist, fpath & ":" & thename) of me
    end if
    processSfolders(sflist, fpath & ":" & thename) of me
    end if
    end tell
    end repeat
    end tell
    end processSfolders
  • tidysteve Level 4 Level 4 (2,975 points)
    no go ... asks which project, but then poops out ... that is it creates a folder on disc but no more than that ... no jpegs in folder ... nothing ...

    any parameters that i need to adjust ???

    seems to be a good start ...
  • ramonr Level 1 Level 1 (5 points)
    Hmm, i got it to export a project with all sorts of nested folders and albums. Although, all of my photos are in albums in folders. If you don't use albums then it wouldn't do anything. I can try to modify the script if that is the case
  • tidysteve Level 4 Level 4 (2,975 points)
    i dont use albums very much ... most images are in project level ... some are nested inside folders ...
  • tidysteve Level 4 Level 4 (2,975 points)
    it works with projects that have an album in it ... i had one with a web gallery under the project level and ran it on that one ...

    is it possible to do the entire library - in hte same folder structure as it resides on in hte package ???

    this is really going to be helpful, if it matures !!!
  • ramonr Level 1 Level 1 (5 points)
    I am not sure how much more it can do, but I cleaned the script up a bit

    property settings : "JPEG - Original Size"
    tell application "Finder" to set location_1 to (choose folder with prompt "Choose a folder to export into") as text

    tell application "Aperture"
    activate
    set x to name of every project
    choose from list x with prompt "Choose a project to export"
    set theP to item 1 of result
    processSfolders({project theP}, location_1) of me
    end tell

    on processAlbums(alist, apath)
    tell application "Aperture"
    repeat with a in alist
    tell a
    set theimages to every image version as list
    set thename to name of a
    tell application "Finder" to make new folder at alias apath with properties {name:thename}
    set destination to apath & thename & ":"
    with timeout of 6000 seconds
    tell a
    export theimages using settings to alias destination
    end tell
    end timeout
    end tell
    end repeat
    end tell
    end processAlbums

    on processSfolders(flist, fpath)
    tell application "Aperture"
    repeat with a in flist
    set thename to name of a
    tell application "Finder" to make new folder at alias fpath with properties {name:thename}
    tell a
    set sAlist to every album
    set sflist to every subfolder
    processAlbums(sAlist, fpath & thename & ":") of me
    processSfolders(sflist, fpath & thename & ":") of me
    end tell
    end repeat
    end tell
    end processSfolders
  • KeithFN Level 1 Level 1 (0 points)
    works great. tu!
  • KeithFN Level 1 Level 1 (0 points)
    bro! can you improve script a bit?

    i have structure like project->folders->albums
    every project has a lot of folders. is it possible to export folder that i choose, not a full project?
    Better if you will have a choose what to export - library or item (like folder or album) from library. this script works great.

    ty
    Keith