Pratique pour une personne qui veut deswitcher, ou faire un backup compatible avec Windows par exemple.
Enfin bref, je me dit que ça peut servir donc je le mets à dispo
(c'est certainement optimisable, parce que la ça prends un temps FOU)
-- choix pour l'utilisateur du répertoire de sauvegarde
tell application "Finder"
set main_output_folder to choose folder with prompt "Select output folder"
end tell
tell application "iPhoto"
-- récupération de la liste des albums
set album_list to every album
-- boucle pour chaque album
repeat with i from 1 to the count of album_list
set current_album to the item i of album_list
set album_name to the name of current_album
set test to the type of current_album
-- seulement pour les vrais albums (IE pas la phototèque, pas la dernière pellicule ...)
if test is equal to regular album then
-- création du répertoire pour l'album
tell application "Finder"
-- si le répertoire n'existe pas, on le crée
if not (exists folder album_name of main_output_folder) then
make new folder at main_output_folder with properties {name:album_name}
end if
-- répertoire pour l'export
set album_folder to folder album_name of main_output_folder
end tell
-- pour chaque image de l'album
set album_photos to every photo of the current_album
repeat with j from 1 to the count of album_photos
set current_photo to the item j of album_photos
set photo_file to (POSIX file (image path of current_photo as string)) as string
--copie de la photographie
tell application "Finder"
duplicate photo_file to album_folder with replacing
end tell
end repeat
end if
end repeat
end tell

