TextToClipboard - Forum

Forum Navigation
You need to log in to create posts and topics.

TextToClipboard

I have some HTML text in"Container2" and I want to copy it to the clipboard.

TextToClipboard "Container2"      does not work...

how do I set the value of Container2 to a variable?

.

I finally did not use TextToClipboard

I used this javascript instead:

BeginJS
var copyT = document.getElementById('Container2').innerText;
navigator.clipboard.writeText(copyT);
EndJS

.

 

@fkapnist

how do I set the value of Container2 to a variable?

One workaround would be to populate the Container like so ...

SetVar "[textContainer2]" "<strong>Hello</strong></br></br>Just another line of text"
SetObjectHTML "Container2" "[textContainer2]"

... then, when you want to copy it to the clipboard ...

TextToClipboard [textContainer2]

... the Clipboard will contain something like ..

<strong>Hello</strong></br></br>Just another line of text

luishp, Vadim and fkapnist have reacted to this post.
luishpVadimfkapnist