Sending multiple commands with 'dopusrt.exe /cmd'

I have a button which asks for confirmation before loading my main layout

@confirm Load Layout "Main"? Prefs LAYOUT Main
What I want to do is create a batch file that does this. Is it possible to include more than one command on a single call to 'dopusrt.exe'?
e.g.

dopusrt.exe /cmd @confirm Load Layout "Main"?; Prefs LAYOUT Main

Thanks in advance.

You can't use @ modifiers with dopusrt directly.

Instead, create a User Command (Customize -> Commands, User category) and then run that via dopusrt.

In general, you can run multiple commands via dopusrt by running dopusrt multiple times, once per command. But since you cannot run the @ modifiers from dopusrt directly that won't help here. (Even if you could it wouldn't be useful: The @confirm would cancel the first dopusrt command (which was just the @confirm itself) and then your batch file or whatever would run another command via dopusrt, independently of the @confirm.)

Alternatively, create a button normally, then drag it to your desktop. That will create a .dcf file which you can double-click to run the button.

You can also launch .dcf files from batch scripts using the "start" command.

Thanks a lot -- very useful. My only question is -- you said:

How do I run it? I tried this:

dopusrt.exe /cmd <my User Command name>

I once created a little utility which can be run from dos and shows you
a custom requester with one or up to 10 buttons to choose from.

Like "c:RequestChoice" in old amiga days.. if that is of any help, i'd
put it up here somewhere.

Regards,
Rob.

[quote="lee321987"]How do I run it? I tried this:

dopusrt.exe /cmd <my User Command name>

That's correct.

Unless you've added the Opus directory to your system path you will need to use the full path to dopusrt.exe, in quotes since there's a space in the path.

I know (but thank you). I ran it from DOpus's root dir.
I think I figured it out -- it works, but not with buttons that utilize the currently selected files (or current directory). Well, it still works, but does not send the arguments. Right?

Arguments like {file} are expanded by Opus before it runs commands, whether they are internal or external. The commands themselves do not know anything about {file} and similar codes.

So if you are running a command via dopusrt.exe from outside of Opus then whatever you are running the command with needs to supply the file names and won't understand Opus-specific codes like {file}.

Commands which naturally use the selected files, without them being passed as arguments, will still work on the selected files even when run externally. For example, if you run dopusrt.exe /cmd Copy then it will copy the selected files in the active window to the destination window.