Would it be possible to have a script that watches an album within the desktop Photos App (Mac OSX) and then copies new images or videos to a local folder? Any advice on how to get started with this would be greatly appreciated.
set destinationFolder to choose folder
tell application "Photos"
set thePhotos to every media item of album "Alexandra"
export thePhotos to destinationFolder with using originals -- not rendered as jpg
-- export thePhotos to destinationFolder without using originals -- rendered as jpg (for smaller size)
end tell
NOTE: Alexandra is my dauther’s name.
Exporting only the photos added last 24 hours:
set destinationFolder to choose folder
tell application "Photos"
set thePhotos to every media item of album "Alexandra"
repeat with i from 1 to (count of thePhotos)
set thePhoto to media item i of album "Alexandra"
if ((current date) - (date of thePhoto)) < 24 * 60 * 60 then -- last day added photos
export (thePhoto as list) to destinationFolder with using originals -- not rendered as jpg
-- export (thePhoto as list) to destinationFolder without using originals -- rendered as jpg (for smaller size)
end if
end repeat
end tell