omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    How to get Panoramas smart album by name

    Pythonista
    2
    2
    1660
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • niz
      niz last edited by

      Hi
      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[1]
      
      1 Reply Last reply Reply Quote 0
      • cvp
        cvp last edited by cvp

        smart_albums = photos.get_smart_albums()
        for smart_album in smart_albums:
        	if smart_album.title == 'Panoramas':
        		panoramas = smart_album
        		break
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors