Copy text to clipboard by double clicking?
Jan 07, 2013
Hello,
I am building a troubleshooting decision tree for use in production.This will basically be one big slide with tons of layers.
This will be used when chatting with customers, so one functionality I would like is to have certain objects, which when double-clicked, would copy certain text to the users clipboard.
I thought maybe I could accomplish this with the execute javascript trigger. I looked up java script online and found some for copying text to clipboard. I entered this code in the trigger, but when I published and double-clicked the object, nothing happened.
I don't know much about java script, so I don't know if the problem is with the code or if I'm doing something wrong in Storyline.
Can someone tell me how I can accomplish this? I just want certain text to copy to the users clipboard when they click on certain objects on the screen.
If it helps, here is the code I was trying to use:
function copyToClipboard(text)
{
if (window.clipboardData) // Internet Explorer
{
window.clipboardData.setData("Text", text);
}
else
{
unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
clipboardHelper.copyString(text);
}
}
Thanks!
1 Reply
There is a way to do this but requires you to edit the "story.html" file and it only works in IE (4 and above)
I have attached a PDF containing the instruction. Hope this helps.
This discussion is closed. You can start a new discussion or contact Articulate Support.