2 Replies Latest reply on Feb 7, 2017 8:34 PM by martinl90743871

    copy to clipboard

    martinl90743871

      Hi community,

       

      I'm working on a publish service and I'd like to use the goToPublishCollection menu (on the right click of a publish collection) to copy the remote URL into the clipboard.
      I still didn't find any solution to do that. Neither in the SDK or in the usual LUA documentation...

       

      Would you have any ideas? Is that possible with Lightroom_sdk?

       


      Thnk you!
      Cheers
      Martin

        • 1. Re: copy to clipboard
          johnrellis Most Valuable Participant

          You can't do this directly with the SDK. But your plugin could use LrTasks.execute() to invoke a command-line utility that will set the contents of the clipboard.  A quick Google suggests "pbcopy" on Mac and "clip.exe" on Windows.

          • 2. Re: copy to clipboard
            martinl90743871 Level 1

            It is working!! Thank you Jogn!
            I don't think about LrTasks enough :-)

             

            Here is the solution in case somebody else want.

             

            local copyCmd = "echo '"..info.remoteUrl.."' | pbcopy"

            if prefs.os == "Windows" then

                  copyCmd = "Echo "..info.remoteUrl.." | clip"

            end

                  LrTasks.execute(copyCmd)