Skip to content

Instantly share code, notes, and snippets.

@hmasato
Last active December 19, 2015 13:58
Show Gist options
  • Select an option

  • Save hmasato/5965720 to your computer and use it in GitHub Desktop.

Select an option

Save hmasato/5965720 to your computer and use it in GitHub Desktop.
[Softimage, Win] _sendToNotepad.js
function _notepad(str)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var wsh = new ActiveXObject("WScript.Shell");
var dir = wsh.ExpandEnvironmentStrings("%temp%");
var sn = ActiveProject.ActiveScene.Parameters("Name").Value;
var fn = dir + "\\" + sn + ".txt";
var f = fso.CreateTextFile(fn, true, false);
if(f==null) return;
f.WriteLine(str);
f.Close();
wsh.Run(fn);
// wsh.Run("cmd.exe /c clip < " + fn, 0, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment