How to Close a Tab Other Than Current One?

Hello All,

Is there a way to use DO raw commands to close a tab with a specific path, i.e. other than the current tab?

Something like "FindExisting" in the Go command.

TIA,
TheTruth

This seems to do the trick:

Go NEWTAB=findexisting PATH=C:\ Go TABCLOSE

First you switch to the tab, then you close the current tab.

If there isn't already a tab for that path then the button causes it to open for a moment and then close, which seems acceptable.

Yesssss, that's it, smart trick.

what if the tab is in the dest/inactive pane? That's the case I have.

Thanks,
TheTruth

If it's always in the destination pane then I think I know a way to make it close, but if you want a button which closes the tab whether it's in the source or destination then I'm not sure about that. I can think of a way but it might do unwanted things in some situations (e.g. in a single-pane lister).

Yes.

Go ahead, even though, one may catch something new. I like most of the ideas you come up with.

Thanks,
TheTruth

Mouse has moved, Windows needs to restart your computer for the changes to take effect.

Waiting...

This will close the C:\ tab in the destination side. It's not perfect, though: If there is no C:\ tab in the destination then it closes the active destination tab and opens a new C:\ tab in the source. :slight_smile:

Set FOCUS=Dest Go NEWTAB=findexisting PATH=C:\ Go TABCLOSE Set FOCUS=Dest

To make a button which closes a specific tab in either side of the lister, without opening extra ones by accident etc., I thought would require a bigger hack involving dopusrt and some delays between the commands to make sure everything runs smoothly. You can insert delays using the ping command (a sub-hack within the overall hack, if you like). Of course, buttons like this aren't great because if the PC is running slowly one day then it'll all go wrong.

This is a horrible button and I'm not suggesting that anyone uses it, but here it is anyway:

runmode hide Set FOCUS=Dest ping localhost -n 2 >nul Go NEWTAB=findexisting PATH=C:\ ping localhost -n 2 >nul Go TABCLOSE ping localhost -n 2 >nul Set FOCUS=Dest ping localhost -n 2 >nul Go NEWTAB=findexisting PATH=C:\ ping localhost -n 2 >nul Go TABCLOSE

Edit: It turns out all the sync and dopusrt stuff wasn't needed (as usual). I've updated the button above so it's now slightly less horrible. (But the ping hack still makes it horrible!)

Thanks gazillions nudel, the enhanced version is what I need exactly, still smart!!!!!

As for the last button, I always in the opposite pane, so the first one best fits, but the latter shows new way one can handle async events.

Thanks,
Thetruth

Opus 9.0.0.3 added a feature to make all of this much easier:

Oh, thanks jon, greg, you really impress me with your commitment and giving high attention to every detail.

@nudel
It works as in book but in the active File Display only, It doesn't search in the dest one, and using it with your button has sync issues, so I reverted to your old button.