2 Replies Latest reply on Aug 19, 2017 3:58 PM by Avizzv92

    Observe when a photo has been selected within the library module?

    Avizzv92 Level 1

      Is there a way to add an observer or something in order to know when the user has selected a different photo from within the library module? Essentially I want a function to be called when the user changes the selected photo within the library.

        • 1. Re: Observe when a photo has been selected within the library module?
          johnrellis Most Valuable Participant

          You could try the undocumented LrApplication.addActivePhotoChangeObserver. Its signature may be similar to LrDevelopController.addAdjustmentChangeObserver.  Make sure you're trapping all errors or using a debugger while you're experimenting with it.

           

          I vaguely recall trying it out a couple years ago and deciding not to use it, but I can't remember why. I have an even vaguer memory that Rob Cole may have noticed that some changes in selection weren't getting reported.

           

          A couple of my plugins poll every quarter of a second or so for changes to module and selection. It offends the more delicate architectural sensibilities, but it works well without imposing a noticeable CPU cost.

          • 2. Re: Observe when a photo has been selected within the library module?
            Avizzv92 Level 1

            I implemented the LrApplication.addActivePhotoChangeObserver function. So far I have not noticed any adverse side effects, it's working for me as expected. I'll keep an eye out for anything weird as its undocumented. Thanks!

            1 person found this helpful