I maintain an Images folder with monthly subfolders 2009-01, 2009-02, etc. and have created a button to open the most recent month's subfolder. On my system (XP, 32-bit), the first block of code does not work reliably if the right pane of a dual lister is active when the button is clicked. On the first click of the button it doesn't get as far as executing the sort but it does open the parent folder in the left pane and makes the left pane active. An immediate second click gets as far as the Select FIRST, and a third click goes all the way.
The second block of code always works. My feeling is that for certain types of command sequences, there is a need to slow things down in order for Opus to complete the full set, at least when switching between Source and Dest panes. Using dopusrt appears to be a way of doing that.
Regards, AB
Unreliable Code
Go C:\Images OPENINLEFT
Set focus=left
Set SORTBY=name SORTREVERSE=On
Select FIRST
Go FROMSEL
Reliable Code
Go C:\Images OPENINLEFT
//Use dopusrt to introduce a short delay
dopusrt /cmd Set focus=left
dopusrt /cmd Set SORTBY=name SORTREVERSE=On
dopusrt /cmd Select FIRST
dopusrt /cmd Go FROMSEL
It's not slowing things down that fixes it; it's running the second set of commands within the context created by the first set, instead of within the original context.
Leo, could you be more specific in your explanation. Are you saying that..
Go C:\Images OPENINLEFT
is the original context and..
dopusrt /cmd Set focus=left
dopusrt /cmd Set SORTBY=name SORTREVERSE=On
dopusrt /cmd Select FIRST
dopusrt /cmd Go FROMSEL
is the second set of commands?
I have often bumped against what look(ed) to me like timing/synchronisation issues with sets of commands that involve dual panes but have not found anything in the documentation that addresses this phenomenon.
I can't be more specific without trying a lot of combinations myself.
There could be more than one point where the context changes but the commands keep using the old context. (That happens by default; it's only where Opus explicitly updates the commands' context that it doesn't happen.)
However, if all commands (or all but the first command, which is the same) use dopusrt then each command is effectively completely separate and inherits all context changes made by the previous command(s).
So if in doubt, use dopusrt if you need a command to see changes made by the previous ones to the current folder, file selection, sort order, etc.
(I think selection is one where you don't need dopusrt, but I'm not certain.)