RhetTbull / PhotoScript

Automate Apple / MacOS Photos app with python. Wraps applescript calls in python to allow automation of Photos from python code.
MIT License
49 stars 5 forks source link

Moving an album from a subfolder, to another #34

Closed anjos closed 2 years ago

anjos commented 2 years ago

First of all, many thanks for this awesome library! Really great work.

I have a collection of subfolders that are due to a badly imported old album collection: Folder A / Folder B / Album C

I'd like to move Album C to Folder A (and then delete Folder B, which is easy). I looked at the API, but there are no obvious ways to achieve this. Or do I miss something?

RhetTbull commented 2 years ago

There’s no move_album type method if that’s what you’re looking for but it wouldn’t be hard to do this with a small amount of python. I’d do something like this:

Create Album C in Folder A: new_album_c = PhotosLibrary().make_album_folders(“Album C”, [“Folder A”]) Add photos from the original album to the new album:

new_album_c.add(album_c.photos())

You can then delete the old album.

anjos commented 2 years ago

Right - thanks!