4 Replies Latest reply on Oct 19, 2013 9:15 AM by Jacques76901

    activate collection from plugin

    Jacques76901

      Hi,

       

      my plugin creates a collection and adds some photos to it. How can I make this collection the active collection. i.e showing the user of my plugin the photos in this collection. Is it possible to set the sort order to "Custom" for the collection programatically.

       

      Thanks Jacques

        • 1. Re: activate collection from plugin
          johnrellis Most Valuable Participant

          How can I make this collection the active collection. i.e showing the user of my plugin the photos in this collection.
          See catalog:setActiveSources().

           

          Is it possible to set the sort order to "Custom" for the collection programatically.

          Not via the the SDK. 

          1 person found this helpful
          • 2. Re: activate collection from plugin
            Jacques76901 Level 1

            John R. Ellis wrote:


            Is it possible to set the sort order to "Custom" for the collection programatically.

             

            Not via the the SDK. 

             

            John, thank you. However with Jeffrey Friedl's "Proximity Search Plugin" (http://regex.info/blog/lightroom-goodies/gps-proximity) you can exactly do that.

            I will ask Jeffrey. Maybe he tells me his secret trick.

             

            Jacques

            • 3. Re: activate collection from plugin
              johnrellis Most Valuable Participant

              I just tried the Proximity Search plugin, and it isn't able to change the user interface's Sort for the colleciton to "User Order" programmatically.  It can only get halfway there.

               

              It creates a collection representing the search results, and then it asks the user to manually change the sort order to "User Order" in the user interface (because the SDK won't let a plugin do it automatically):

               

              Capture.PNG

              When the user changes the order to "User Order", the collection is sorted according to the order that the plugin has defined.  It appears that when a plugin adds photos to a collection via collection:addPhotos (photos), the SDK preserves the order of the photos in "photos" as the user order.   But the user still has to manually change the sort order in the user interface.

              • 4. Re: activate collection from plugin
                Jacques76901 Level 1

                John, I think you are right. I had obviously changed the sort order of the "Proximity search results" collection to "User Order" in the past and got confused when I used the plugin yesterday as I had the feeling that the sort order was set to "User Order" programmatically.