Ok, he estado recorriendo la web para una solución similar como yo realmente encontrar Fotos de un pobre sustituto para la Apertura.
Esta es una secuencia de comandos de AppleScript puse basado en varios trozos escogidos de preguntas similares pero que no hacen exactamente lo que yo necesitaba.
Puedo decir que este solo funciona con el OS X, El Capitan, Apple Fotos y mis 70 GB de fotos y videos, he añadido un par de error de comprobación de pasos, se podría hacer mucho más elegante así que cualquier comentario más que bienvenidas.
La razón por la que tiene la lógica para la selección de álbumes basados en el nombre, es que de lo contrario la rutina de ir a través de todos los álbumes, incluyendo los de fábrica y exportación de todo. Yo uso AAAA como inicio de cada album así que es fácil seleccionar lo que quiero exportar. Posiblemente usted puede buscar cómo comprobar la carpeta principal o alguna otra lógica para asegurarse de que el texto recorre la derecha.
--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