AppleScript add videos in Photos library to specific album, from their name on disk

I'm trying to use AppleScript to move videos to a specific folder. I have a program that determines if the videos should be moved to that folder, using directly the video files on disk within the Photos Library container. Therefore, I have the path and name of the files on disk, within the library.

Now I would like basically to tell photos to add these videos to a specific album, but I do not know how to identify these videos within the script.

I know from the Photos script definitions that each media item should have a filename property, but I don't know how to select an element based on its filename...

My idea (which doesn't work as is) :

tell application "Photos"
	set ImgSel to (get media item with filename "033F9BD2-9DB3-4DCD-B281-0714BDC50C48")
	add ImgSel to album "AppleScript album"
end tell

Posted on Jul 1, 2021 2:57 AM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

AppleScript add videos in Photos library to specific album, from their name on disk

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.