Skip to main content
martinl90743871
Known Participant
February 8, 2017
Answered

copy to clipboard

  • February 8, 2017
  • 3 replies
  • 964 views

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

This topic has been closed for replies.
Correct answer johnrellis

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.

3 replies

Participating Frequently
March 14, 2023

Maybe this works for future visitors on this topic: https://lrcopytoclipboard.com/

martinl90743871
Known Participant
February 8, 2017

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)

johnrellis
johnrellisCorrect answer
Legend
February 8, 2017

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.