Multiple Command Output Windows

Help with writing and running scripts

Multiple Command Output Windows

Postby NemysysX » Tue Mar 18, 2008 10:12 am

When scripting, and testing scripts, the command output window is really useful.

Trouble is, I may be working on several scripts at once, and I end up getting several of these command output windows open.
Is there any way to reuse the same command output window each time?

Either one window per script file, or one window total, without having to close them manually each time?


Forgot to mention, I'm using V14.0a
NemysysX
Newbie
 
Posts: 2
Joined: Tue Mar 18, 2008 10:09 am

Re: Multiple Command Output Windows

Postby jorrasdk » Wed Mar 26, 2008 7:09 am

I'm not sure what you mean. In UE you have one "Output Window" for script output (like UltraEdit.outputWindow.write("foo") ) - but whenever you run a DOS command or a User Tool with the "Capture Output" option set a new "Command output window" is opened.

A "Command output window" cannot as such be reused. But since they are ordinary editor windows (documents in script terms) you can setup your script to do some "housekeeping" and close unwanted "Command output windows" before a new window is created in by the script when a UserTool is invoked.

Code: Select all
for (var i=UltraEdit.document.length - 1;i >= 0 ;i--) {
  if(UltraEdit.document[i].path.substr(0,14) == 'Command Output') {
    UltraEdit.closeFile(UltraEdit.document[i].path,2);
  }
}


If you only want to close 'Command output' related to a certain script, then do a find (UltraEdit.document[i].findReplace.find("...")) for specific strings and close the files depending on the find result.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Multiple Command Output Windows

Postby NemysysX » Thu Mar 27, 2008 10:35 am

Thanks

Your comments really helped, I was using the (F9) DOS command to launch my VBS scripts (using Cscript)

Thanks to your comments, I looked at the tools section, created a tool to launch the file, and within there you have more control over the output.

Bingo, it worked!

Thanks very much
NemysysX
Newbie
 
Posts: 2
Joined: Tue Mar 18, 2008 10:09 am


Return to Scripts