This site https://clipboardjs.com has a js widget which copies to the clipboard when you click manually, but does not work (for me) when i run the script.
{
“Name”: “ClipboardCopy”,
“CreationDate”: “2024-7-1”,
“Commands”: [
{
“Command”: “store”,
“Target”: “this content should be overwritten at macro end”,
“Value”: “!clipboard”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “https://clipboardjs.com/”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “id=bar”,
“Value”: “”,
“Targets”: [
“id=bar”,
“xpath=//[@id="bar"]",
“xpath=//textarea[@id=‘bar’]”,
“xpath=//textarea”,
“css=#bar”
],
“Description”: “”
},
{
“Command”: “XClick”,
“Target”: "xpath=//[@id="example-action"]/div[2]/button”,
“Value”: “”,
“Targets”: [
“xpath=//*[@id="example-action"]/div[2]/button”,
“xpath=//div[2]/button”,
“css=#example-action > div.form-actions > button”
],
“Description”: “”
},
{
“Command”: “echo”,
“Target”: “This is in clipboard: ${!clipboard}”,
“Value”: “green”,
“Description”: “”
}
]
}