How to get Panoramas smart album by name
I'm using the photo module to get the smart album AssetCollection. From that I can select the Panoramas album by referencing it's index, but if I want to share this script I would assume that the Panoramas album will not always be in the same position within the smart albums list.
Does anyone know if I can reference it by name?
smart_albums = photos.get_smart_albums() panoramas = smart_albums
smart_albums = photos.get_smart_albums() for smart_album in smart_albums: if smart_album.title == 'Panoramas': panoramas = smart_album break