6 Replies Latest reply on Nov 5, 2010 2:53 PM by areohbee

    catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )

    areohbee Level 5

      A way for a plugin to retire a photo would greatly help in writing plugins that need to retire obsolete versions of photos...

       

      And of course: catalog:moveOrRenamePhoto( photo, from, to ) is sorely missing...

       

      PS - toss in catalog:moveOrRenameFolder( from, to ) and we'd really be having things!

       

      Thanks in advance,

      Rob

        • 1. Re: catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )
          johnrellis Most Valuable Participant

          Since posting this, have you come up with any workarounds for deleting photos from the catalog?

          • 2. Re: catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )
            areohbee Level 5

            HI John,

             

            In cases where this has come up so far for real, I have only come up with half-baked work-arounds, for example:

             

            • Just selected the photos and prompted the user to delete them.

             

             

            Mostly, I've just postponed catalog maintenance plugins until Lr4.

             

             

            If you really want to do it automatically / programmatically, I could imagine using keystroke scripts. e.g. somehow make sure user is in grid view (e.g. by issuing keystrokes), selecting the photos to delete, then issue a 'Backspace' keystroke. I assume one could also issue the keystroke to respond to the delete confirmation dialog box. I have used this technique for things like reading metadata from files - should work for deleting as well.

             

            On Windows, you can easily write these scripts using the send-key function in vbscript.

             

            On Mac - Applescript has the most straight-forward built-in functionality, but you can also use shell scripts.

             

            Rob

            • 3. Re: catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )
              johnrellis Most Valuable Participant

              Thanks for those suggestions.  A few users of Any File have asked for the ability to remove selected Any File-managed files from the catalog (both the proxy and the underlying file); perhaps the best approach is for Any File > Delete to delete the actual files and then leave them selected in LR, with a prompt to delete them.

              • 4. Re: catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )
                areohbee Level 5

                That would work, and that's what I've done so far, although the keystroke to delete for them is worth consideration if you want it to be really slick...

                 

                Maybe I'll add "deletePhoto" and "removePhoto" to the base classes (forming on the lrdevplugin assembla site) that use the keystroke, hmmm.... or maybe you could mastermind it, then I/we could borrow it(?)

                 

                Rob

                • 5. Re: catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )
                  johnrellis Most Valuable Participant
                  or maybe you could mastermind it, then I/we could borrow it(?)

                  I may opt for the simpler solution for now.  Even if the keystroke class existed, I'd be a little leary of it, since my experience in the past has been that keystroke stuffing is fragile (I used several keystroke products over the years with Photoshop Elements and other products).

                  • 6. Re: catalog:deleteOrRemovePhoto( photoOrPath, deleteOrRemove )
                    areohbee Level 5

                    johnrellis wrote:

                     

                    I may opt for the simpler solution for now.  Even if the keystroke class existed, I'd be a little leary of it, since my experience in the past has been that keystroke stuffing is fragile (I used several keystroke products over the years with Photoshop Elements and other products).

                     

                    I haven't had any problems with keystrokes m'self, but it doesn't surprise me that they can be problematic. In fact, personally, it surprises me that they are even allowed by the operating systems. I've always thought that keystrokes should come from the keyboard, unless the keyboard stuffer goes through a security protocol, not unlike making an ssl connection. Then we wouldn't need keyboard logger testers in our security software, nor worry about trojan horses stuffing keystrokes (because they would have to have a certificate from an authority in order to function).

                     

                    If you find yourself with a free moment, I'd be curious to know more about this "fragility" you've experienced. Maybe drop a "Pearl Of Wisdom" over at assembla/lrdevplugin(?)

                     

                    Rob