Using leavedoswindowopen in script

Hi all,

I'm working on a fairly involved js button script which calls an external command line tool. Currently I'm stumped because I can't get the DOS window to stay open. Here's a reeeaaallly simple version of the script:

function OnClick(clickData)
{
	DOpus.ClearOutput();

	var cmd = clickData.func.command;

	cmd.AddLine("@leavedoswindowopen");
	cmd.AddLine("external-tool.exe -dosomething");
	cmd.SetModifier("leavedoswindowopen");

	cmd.Run();
}

As you can see, I've already trie two ways of setting the command modifier. The command works just fine, but the window keeps closing after execution. No other modifiers are used, ie. the "Modifiers" tab of the Command Editor is empty. Adding @leavedoswindowopen there didn't help either.

What am I missing?

Thanks a lot!
MartO

Did you put

cmd.SetType('msdos');

in your main script?

Thank you, thank you, thank you!!! :slightly_smiling_face: :upside_down_face: :slightly_smiling_face: