If it's an MS-DOS type of button then you can use the usual DOS batch commands for that, but keep in mind that strange things will happen if you mix in any Opus commands. (Behind the scenes, Opus splits the batch up into smaller batch files every time it has to run an Opus command, so conditional logic and loops will be broken.)
For non-DOS scripts there isn't any way to handle errors. Opus commands don't have any branching or conditional logic. (That's not quite true. You can make them do different things when Ctrl/Alt/Shift are held down but that's not relevant here.)
Essentially, if you want to do anything complex with conditional logic you are often better off writing a VBScript which you run from Opus, using Opus to pass in arguments like lists of selected files, source and destination directories, and so on.
(If you need to pass a lot of selected files then you can avoid command-line length limits by using the filem modified. For example, {allfilepath|filem} will write all the selected file paths into a temporary file and then pass the name of the temporary file to the program/script.)
[/quote]
Good to know.. Sometimes errorhandling is essensial.
Apparently variables cant be expanded when used with {dlgchoose} and probably partners.
This works fine: {dlgchoose|{sourcepath}|1}
This doesn't work: {dlgchoose|{$test}|1}
It do work where it matters most, only can't use those in dialogs.
[quote="nudel"]
I see buttons also supports the @script modifier, but there isn't any way to pass variables from dopus to a script..
I think (not completely sure) that the @script modifier is only useful with Rename buttons at the moment.
To pass variables from Opus to a script just use the command line. Here's an example script written to be called from Opus:
[One Hotkey for 2 commands - #3 by Leo)[/quote]
Thank you for the info..
I hope they make real scripting in DO more usable in a future version though.