How can I send information to the clipboard from perspective?
I found this solution here on the forum:
from java.awt import Toolkit
from java.awt.datatransfer import StringSelection
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
It works in the script console, but when I call this function on an onActionPerformed from a perspective button, it doesn’t work. This error happens:
Has anyone here tried this?
Well I will say that there are web pages that provide buttons that will copy text into the clipboard so I would say it is possible but as @pturmel said you have to make a custom component to do that.
Is there any documentation on creating a custom component?
Hey Victor, did you get anywhere with this in the end?
The java script side wouldnt be hard
What are you trying to copy?
Me, I want to copy json for dev tools
hmm you should be able to print objects to the console.log with system.util.print()