Open a folder in an adjacent tab

Is this possible?
I have looked and cannot see an internal command solution (though there may well be)

SCENARIO A
Consider I have 2 tabs "Parent" and "Child" adjacent to each other.
Parent tab is to the left of Child.
Parent is the current tab and the cursor is over a folder FolderA
I want to hit a defined keystroke which will open FolderA in the Child tab.
I am not sure at this point if I want focus to move to the Child tab or not

SCENARIO B
Consider I have 2 tabs "Parent" and "Child" adjacent to each other.
Parent tab is to the left of Child.
Parent is the current tab and the cursor is over a folder FolderA
I want to hit a defined keystroke which will open FolderA in a New tab positioned to the RHS of Parent i.e. between Parent and Child tab.
Again not sure where I want focus to be after

Anyu comments greatly appreciated as always

Scenario B is easy:

Go FROMSEL NEWTAB TABPOS=+1

(If Preferences / Folder Tabs / Tab Bar / Open new tabs next to the active tab is on, then the TABPOS=+1 is not neccessary, but also does no harm.)


Scenario A is more complex. You could use a script to tell the next tab to change folders... But it's probably easier to just close the next tab, then open a brand new tab, which doesn't need a script:

Go TABSELECT=+1
Go TABCLOSE
Go FROMSEL NEWTAB TABPOS=+1

Just be careful not to use that when there isn't another tab to the right, as it won't work as desired. A script could handle that kind of thing if you needed it to work in that situation.


With both commands, you can change NEWTAB to NEWTAB=nofocus if you don't want the new tab to become active.

That was quick Leo!
Thank you I will absorb..... thank you again :slight_smile:

From 12.15.4, you can do Scenario A with a slightly simplified command, and without worrying about there not being a next tab:

Go TABCLOSE TABPOS=+1
Go FROMSEL NEWTAB TABPOS=+1

That won't work in the current version though.

2 Likes