7 Replies
Martin Sinclair
Zsolt Olah

In my advanced Storyline session at the ATD TechKnowledge conference people asked me if there's a way to copy text from a variable to the clipboard programmatically, so the user can paste it somewhere. 

Yes, try this (using JavaScript):

https://www.rabbitoreg.com/examples/p99/#/lessons/NPQ2NG0PlDgwjy_ZLbmw6t0PPaoWFEB6

 

Thanks got this Zsolt - just built an troubleshooter that sits in an iframe pop-up within one of our tools, and this JS copies some text across to an email which can then be sent straight to our IT dept when things go wrong. Super useful!

 

Last piece of the jigsaw. When the text is copied, in the top left of the browser it shows a text box with the copied text. I believe this is because the JS creates the textboc then copies its contents. So how can I get the textbox to delete after this has taken place?

Thanks for any help!

Yu Ying Lin

Hello! Thank you for this function. I am planning to use it for my e-learning project. There's one question: if I want to have several lines in the text, how can I do that?

For example, there's a code I want my learners to copy like the following:

 

cd git-fundamental-repo01

echo "hello world" > file1.txt

cat file1.txt

 

How can I make it happen in just one click?