Created
May 10, 2013 06:47
-
-
Save hmasato/5552794 to your computer and use it in GitHub Desktop.
[Softimage, Win] _sendToClipboard.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _sendToClipboardStr(str) | |
| { | |
| var wsh = new ActiveXObject("WScript.Shell"); | |
| var fs = new ActiveXObject("Scripting.FileSystemObject"); | |
| var fn = wsh.Environment("Process")("TEMP") + "\\_sendToClipboard_.tmp"; | |
| var f = fs.CreateTextFile(fn, true, false); f.WriteLine(str); f.Close(); | |
| wsh.run("cmd.exe /c clip < " + fn, 0, true); | |
| } | |
| function _sendToClipboardFile(filename) | |
| { | |
| var wsh = new ActiveXObject("WScript.Shell"); | |
| wsh.run("cmd.exe /c clip < " + filename, 0, true); | |
| } | |
| { | |
| //var sels = Selection.GetAsText(); | |
| //_sendToClipboardStr(sels); | |
| //_sendToClipboardFile("test.txt"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment