Go BACK runs in dest instead of source

Hi there! o)

I noticed a little weirdness while enhancing my tiny folder format overrider, which evaulates the number of folders and then makes use of "Go .. NOSCRIPT" to set viewmode or format "manually", cancelling the OnBeforeFolderChange() event at the same time.

If there's a dual lister opened and "Go BACK" is run, and you run "Go BACK NOSCRIPT" within OnBeforeFolderChange() to emulate regular behaviour, the destination lister is changed, instead of the source. Using SetSourceTab() does not make a difference. And it seems, you need a hotkey to run "Go BACK" and make the event fire. Using the GO command in the commandline of a lister or within a script command to trigger the event, works as expected.

If you run "Go UP NOSCRIPT" in the event, it makes the source change as expected, so there seems to be something wrong with the BACK switch in this special situation. Thanks! o)

/////////////////////////////////////////////////////////////////////////////// function OnInit(data){ data.name = "Command.Folder: GoBackUpTest"; data.default_enable = true; } /////////////////////////////////////////////////////////////////////////////// var FOLDERCHANGE_PROCEED=false; var FOLDERCHANGE_CANCEL=true; /////////////////////////////////////////////////////////////////////////////// function OnBeforeFolderChange(data){ var cmd = DOpus.NewCommand(); cmd.SetSourceTab(data.tab); switch (data.action){ case 'parent': DOpus.Output("Cancelling event, manually 'Going UP'.."); cmd.RunCommand('Go UP NOSCRIPT'); return FOLDERCHANGE_CANCEL; break; case 'back': DOpus.Output("Cancelling event, manually 'Going BACK'.."); cmd.RunCommand('Go BACK NOSCRIPT'); return FOLDERCHANGE_CANCEL; break; default: DOpus.Output("Event not cancelled, doing nothing."); return FOLDERCHANGE_PROCEED; break; } }

There are two issues with this and only one is a bug.

A bug in the current version means that when you run the Go BACK command from a script that was triggered by another Go BACK command, Opus will actually move back two folders instead of one. This will be fixed in the next update.

I wasn't able to reproduce this issue with the folder opening in the destination folder, but what I suspect you're seeing is a side-effect of triggering the command with a hotkey that uses a qualifier key (I'm assuming the Control key). Control is a standard modifier for the Go command to cause the folder to be read into the destination. Normally when a hotkey using a qualifier runs the Go command the hotkey's qualifiers are ignored, but for the second Go command launched via the script this isn't happening. The solution is for you to include the IGNOREQUAL argument on the command line of the second Go command to make it ignore any currently pressed qualifier keys.

Now that you mention that, I agree - I noticed that too. I would have mentioned that, to make things easier for you, but somehow I just focussed on tracking down the "wrong side" issue. That double-go-back was in my subconscious though. I'll try to be more attentive and descriptive the next time.

Oh man, I mean "Mr. Watson", you're so damn right. I did try a lot of things, but really did not thought of "what" hotkey I use to run the first "Go BACK". Now that I use "CTRL+Backspace" things get clearer. I will try that IGNOREQUAL switch, that should indeed cure this side-effect.

Awesome investigation and much appreciated! o))

That IGNOREQUAL switch fixes my "issue", thanks for this and for approaching that double back phenomeno as well! o)