UseClipboard("文字列を渡す\r\n改行もできる");
function UseClipboard(in_stg){
var jp;
if (!jp) jp = {};
if (!jp.raindrop) jp.raindrop = {};
if (!jp.raindrop.frog) jp.raindrop.frog = {};
jp.raindrop.frog.clipboard || (function ()
{
var OLECMDID_COPY = 12;
var OLECMDID_PASTE = 13;
var OLECMDID_SELECTALL = 17;
var _internetExplorer = new ActiveXObject ('InternetExplorer.Application');
_internetExplorer.navigate ("about:blank");
while (_internetExplorer.Busy)
WScript.Sleep (10);
var _textarea = _internetExplorer.document.createElement ("textarea");
_internetExplorer.document.body.appendChild (_textarea);
_textarea.focus ();
jp.raindrop.frog.clipboard = {
setText: function (text)
{
_textarea.innerText = text;
_internetExplorer.execWB (OLECMDID_SELECTALL, 0);
_internetExplorer.execWB (OLECMDID_COPY, 0);
},
getText: function ()
{
_textarea.innerText = "";
_internetExplorer.execWB (OLECMDID_PASTE, 0);
return _textarea.innerText;
},
release: function ()
{
_internetExplorer.Quit ();
}
};
}());
jp.raindrop.frog.clipboard.setText (in_stg);
}