javascript to aquire clipboard contents
I recieved this code from an awesome community member ... but its for a mac user. I'm trying to show a friend with a PC how to use it... is there another way to code 'getting clipboard contents' without it being system specific?
Would calling out Windows instead of Macintosh and Finder work? I'm also not familiar with applescript - does that make a difference with PCs?
I'm still searching around to try and find java for clipboard contents ... but wanted to see if someone here had a solution.
function Main() {
function GetClipboard(){
var clipboard;
if(File.fs == "Macintosh"){
var script = 'tell application "Finder"\nset clip to the clipboard\nend tell\nreturn clip';
clipboard = app.doScript (script,ScriptLanguage.APPLESCRIPT_LANGUAGE);
} else {
var script = 'Set objHTML = CreateObject("htmlfile")\r'+
'returnValue = objHTML.ParentWindow.ClipboardData.GetData("text")';
clipboard = app.doScript(script,ScriptLanguage.VISUAL_BASIC);
}
return clipboard;
}
