Ok, ho cercato sul web una soluzione simile perché trovo le foto come un sostituto inadeguato per Aperture.
Questo è uno script AppleScript che ho messo insieme in base a vari bit scelti da domande simili ma che non hanno fatto esattamente quello di cui avevo bisogno.
Posso dirvi che questo funziona con OS X El Capitan, Apple Photos e i miei 70 GB di foto e video, ho aggiunto alcuni passaggi per il controllo degli errori, potrebbe essere fatto in modo più elegante quindi qualsiasi feedback è più che gradito.
Il motivo per cui ha la logica di scegliere gli album in base al nome è che altrimenti la routine passerebbe attraverso tutti gli album, inclusi quelli predefiniti ed esporterà tutto. Io uso YYYY come inizio di ogni album, quindi è facile selezionare quali voglio esportare. Forse puoi cercare come controllare la cartella genitore o qualche altra logica per assicurarti che lo script iterazioni su quelli giusti.
--AppleScript to export albums from Apple Photos
--Works with OSX El Capitan, Photos V1.3
--Usage: populate the initial variables with the folder to export to.
--It will create it in the desktop but you can use the alternative way
--to create it anywhere).
--Also populate the list of prefixes to look for.
--The script searches for them followed by a space, I use YYYY as
--prefix of all my albums. You may need to add your own logic there.
set theFolderName to "Exported Photos"
set albumprefixlist to {"2014","2013","2010"} -- Example list
set theDestinationRootFolder to POSIX file (POSIX path of file ((path to desktop as text) & theFolderName & ":")) as text
--Alternative:
--set theDestinationRootFolder to "/Users/[username]/Desktop/Exported Photos" as POSIX file as text -- sets the destination folder (use a valid path)
tell application "Finder"
if not (exists theDestinationRootFolder) then
my makeFolder(theDestinationRootFolder)
log "Created root folder:" & theDestinationRootFolder
else
log "Root Folder already exists:" & theDestinationRootFolder
end if
end tell
tell application "Photos"
repeat with i in albums
set tAlbum to get name of i
set tFolder to (theDestinationRootFolder & tAlbum) as text
try
set nYear to text 1 thru ((offset of " " in tAlbum) - 1) of tAlbum as integer
-- We use try here because in many cases there will be an error converting to integer
end try
set tYear to text 1 thru ((offset of " " in tAlbum) - 1) of tAlbum
if tYear is in albumprefixlist then
-- This checks the list, other tests can be done
-- Alternative:if tAlbum begins with "2010" then
-- Alternative: if nYear < 2010 then
log "Processing " & tAlbum
if (count of media items in i) > 0 then
log "Exporting " & tAlbum & " to: " & tFolder
tell application "Finder" to set fileExists to exists my POSIX file tFolder
if not fileExists then
my makeFolder(tFolder) -- create a folder named (the name of this album) in dest
tell application "Photos"
try
export (get media items of i) to (tFolder as alias) with using originals
on error
log "Error with the export command, check the album's content"
end try
end tell
else
log "Error, folder exists, rather not export there"
end if
else
log "Skipping export as it is an Empty album"
end if
else
log "Skipping album " & tAlbum
end if
end repeat
log "Process completed"
end tell
on makeFolder(tPath)
do shell script "mkdir -p " & quoted form of (POSIX path of tPath)
end makeFolder