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 def copy_clipboard(texto): clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() clipboard.setContents(StringSelection(texto),None)
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?