DO11: unable to update tabs/listers via script

Dear all, I'm trying to implement an "open current folder of the active tab in the destination tab" functionality, so I can later assign it to the shortcuts CTRL-Left and CTRL-right. I'm using the CLI to test the script and Im almost there, but unfortunately the tab/lister doesn't change after setting the new desttab path.

The code:

DOpus.Output("---")
DOpus.Output(DOpus.listers(0).activetab.path) // C:\Users\Rene\AppData\Roaming\GPSoftware\Directory Opus
DOpus.Output(DOpus.listers(0).desttab.path) //D:\temp
DOpus.listers(0).desttab.path.Set(DOpus.listers(0).activetab.path)
DOpus.Output(DOpus.listers(0).desttab.path)

Output:

C:\Users\Rene\AppData\Roaming\GPSoftware\Directory Opus
D:\temp
C:\Users\Rene\AppData\Roaming\GPSoftware\Directory Opus

The output shows that the desttab path has been changed correctly, but this change isn't reflected in the DOpus program itself

Also, after invoking the different update methods which should (?) sync the lister/tab, the desttab path is set to it's original path...

DOpus.listers(0).desttab.Update()
DOpus.listers(0).Update()
DOpus.Output(DOpus.listers(0).desttab.path) // desttab path changed back to D:\temp...

Output:

D:\temp

I hope anyone can tell me what I'm doing wrong?

Properties like the tab's path are generally read-only; to change paths you need to run a command.

You don't need scripting at all for this, however. It can be done with a simple one-line command:

Go CURRENT OPENINDUAL

Thank you for the quick reply leo, I've used you're Go alternative, much easier (I wasn't familiar yet with the go command).

But for future reference: the Set() method should have worked according to the specifications, see gpsoft.com.au/help/opus11/in ... g/Path.htm. If possible, could you please tell me why it didn't work?

I now see that the Go command doesn't do exactly what I wanted: I'd like to open the directory under the cursor in the other tab when pressing the hotkey (it's a Total Commander functionality which I use a lot, I'm now switching over to DOpus). Do you have any idea how I can do that?

Go FROMSEL OPENINDUAL will do that.

Re the script thing, the docs you've pointed to just show that you can change the path stored in a Path object. They don't say anything will react to you changing that object.

Things like DOpus.listers(0).activetab provide you with information, but that's all it is. It's a bit like a bank statement posted to you from your bank. It tells you how much money is in your account, and you can write over the top of the figures if you want, but doing so won't change how much is in the account; you have to make a deposit or withdrawal to do that.

Great, works exactly like I had in mind, thanks a lot.

And thanks for the explanation. So if I understand correctly I can only manipulate the tabs et cetera via the commands, not via the script objects. A bit counterintuitive, but I'll manage :wink:

Yes, at least in general. But you can run commands via script objects, too.