Rapise 6.0+

Since Rapise 6 there is no need to use g_util, g_helper and functions as described below. Just use actions Global.GetClipboardText and Global.SetClipboardText.

Legacy

There are a couple special libraries that contains useful things.  These include: g_util and g_helper.  It just happens that the g_util library has a method to get the existing clipboard contents:

var myText = g_util.GetClipboardText();

To copy value from Rapise to clipboard use

g_util.SetClipboardText("Elephant");

To see some of the other useful methods, one can add the g_util or g_helper string to their code window followed by a period (.) and a list of all the methods should pop open.

NOTE: If the script has not yet been saved, this “auto-list” functionality will not be available until the user saves, closes and reopens the script.

 

RVL

To use clipboard in RVL put these functions into *.user.js file.


function CopyToClipboard(/**string*/ value)
{
    g_util.SetClipboardText(value);
}

function CopyFromClipboard()
{
    return g_util.GetClipboardText();
}

The following snippet puts a value into clipboard, then reads it and prints to the report.