Ok, he estado buscando en la red una solución similar, ya que realmente creo que las fotos son un pobre reemplazo para Aperture.
Este es un script de AppleScript que reuní en función de varios fragmentos seleccionados de preguntas similares pero que no hicieron exactamente lo que necesitaba.
Puedo decirles que este funciona con OS X El Capitan, Apple Photos y mis 70 GB de fotos y videos. Agregué algunos pasos de comprobación de errores, podría hacerse de manera más elegante, así que cualquier comentario será más que bienvenido.
La razón por la que tiene la lógica de elegir álbumes en función del nombre es que, de lo contrario, la rutina pasaría por todos los álbumes, incluidos los predeterminados y exportaría todo. Utilizo YYYY como inicio de cada álbum, por lo que es fácil seleccionar cuáles quiero exportar. Posiblemente puede buscar la forma de verificar la carpeta principal o alguna otra lógica para garantizar que la secuencia de comandos se repita en las correctas.
--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