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
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
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
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.