Command to Open Paired Folder in New Tab

Instead of having to open a dual pane to invoke the Paired Folder, in the event that the second pane is already open, it would be great to have a command that opened a new tab in the destination pane.

Something like this perhaps . . .

image

  1. I found no command for "PAIRED", so please include this as a feature request
  2. Does anyone know a work-around in the mean time?

Thanks! :wink:

You can start with this User Command:
GOPAIRED.ouc (1.2 KB)

Go to Settings / Customize Toolbars and Keys. Then select User Commands Tab and then click on Import

Then, just use GOPAIRED (in a button, event, etc) with a dir selected.
Is a very basic command. Feel free to modify it to your taste, read about FSUtil.GetFolderPair and PairedFolder object for more details.

Thank you, errante! Much appreciated . . .

Use this other one if you want to use it with all selected dirs at once.
GOPAIRED.ouc (1.5 KB)

Thanks again, errante!

I know my way around regex, but beyond that I don't know anything about scripting or JS in particular.

Is there any way to modify your first script to open not selected folder(s) (i.e. folders in the current tab), but rather pull the path from the current tab itself?

Yes. Change this 2 lines:

if (clickData.func.sourcetab.selected_dirs.count == 0) return;
var dir = clickData.func.sourcetab.selected_dirs(0);

for:
var dir = clickData.func.sourcetab.path;

Worked! :smile: All credit to you, of course, but it was fun editing the JS!

Much appreciated . . .

You could also use the modifier pair for a code like {sourcepath} to reference the paired folder.

Codes for passing paths

2 Likes