Albums, Arguments and Folders

I can create a new album in the photos app via Pythonista like this:

import photos, sys photos.create_album(sys.argv[1])

Can I also do this with Scriptable and will there be support for Shortcuts to pass on arguments to Scriptable, does that already work or is it not possible?

Further, I’d like to know if it would be possible to do the same but with folders (also regarding the photos app).

In terms of creating new photo albums the Photos documentation only refers to reading and removing photos. Nothing for saving or making albums. Based on that I’d say it isn’t an option right now to create a new album.

Arguments can be passed from Shortcuts to Scriptable if you use the URL scheme.

Take a look in this thread for some details. If it is just an object like an image, then maybe the share sheet could be an option too?

1 Like

There’s currently no API for managing photo albums but it’s a great idea. I’ve added it to my backlog and will include it in a future update.

As a side note, I love when people share ideas for new APIs. It’s difficiult to think of all the APIs that makes sense to add but ultimately, I’d like to offer a lot of different APIs. If there’s demand for an API, then I know it’s worth adding.

3 Likes

Hi Simon, I would love this.

Ideally, the API would be something like (I have no experience with JS so bear with me):

+fromAlbums
static fromAlbums() : Promise<string>
Use this for picking the name of an album from the photo library.

// V1
// I am not sure if this copies the images, if so, then returning paths might be better
+fromAlbum
static fromAlbum(album: string) : Promise<[Image]>
Reads all photos from the specified album.

// V2
+fromAlbum
static fromAlbum(album: string) : Promise<[string]>
Retrieves paths of all photos from the specified album.