Copy text to clipboard by double clicking?

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