I have a series of commands that are normally typed into a dos prompt. I'd like to create a series of menu items that can launch these commands. For an example:
set_project rcf
is one such command. If I create a menu that runs just this line, it seems to take longer than it should to launch, and in addition, the dos window closes immediately after it runs. I'd like the window to stay open so I can read the status of what happened.
Some commands require a specific entry, example:
zb 310
where zb is the command, and 310 the specific item to work on. I'd like to run this from a menu item, and then have a box pop up that asks for the numerical entry (in this case 310).
At this point, I think you are asking to run one command per menu entry and see the command line output.
Advanced ...
Function: MS-DOS Batch Function
zb {dlgstring|numerical entry}
pause
If you don't need the output this could also be run as a Standard Function without the Pause.
To run the entire sequence of commands as a Standard Function,
preceed each command with Sync:
i.e. Sync:zb {dlgstring|numerical entry}
Runmode Hide on the first line will hide the DOS window if you wish.
If it's not just a numerical entry, quotes may also be needed.
Thanks Zippo...I never even noticed the MS-DOS batch function in the dropdown before. I guess everything I've done in the past just used the Standard Function.
I still seem to be doing something wrong though. the command
tools_status
I am attempting to run with this command as a MS-DOS batch command:
tools_status
pause
but it looks like the pause is being ignored. I can see the command running properly, but the dos window closes anyway.
You don't need to use sync: unless you're mixing internal and external commands. To run a sequence of external commands it's definitely not needed.
Pause should work so long as the function is set to the MS-DOS type and the program that you run doesn't do something to make the DOS window close (e.g. call Exit or break the batch file which Opus executes).
Best thing to do is make a batch file yourself that runs the command, and then pause, then run that in a normal DOS prompt to see what happens. If it doesn't work there then it won't work in Opus either.
That's the way I usually do it. Create a separate batch file, run it to make sure it does what I want, then I'll launch the batch file from an Opus button.
You can further increase the power of Opus and batch files by sending the items selected in Opus to the batch file. That way your script will run on what you have selected in Opus.