Page 1 of 1

Open Shortcut Location in Other Pane ?

Posted: 21 Feb 2023 14:13
by GreetingsFromPoland
hi! is there a command or scripting available that would allow me to select a shortcut (LNK) in one pane and have it open the Target Location in the other pane ?

i use:

Code: Select all

#1062;
(Open Folder in Other Pane) quite a bit. recently i found the need to have this functionality. what i have been doing is :

1. in pane 2, double-click the shortcut (LNK) to go to the Target Location
2. then use "Go Here in Other Pane" command (via shortcut or hamburger) (now pane 1 is in the Target Location)
3. still in pane 2, use Back to go back to the original location
4. continue with what i was doing, e.g. copying, moving, etc.

thought it was quick to just select a shortcut, use a command and the other pane is in the Target. in the Customize Keyboard Shortcuts dialog, i use the Jump for words like Open, Pane, etc. and didn't see anything about shortcuts.

Re: Open Shortcut Location in Other Pane ?

Posted: 21 Feb 2023 14:32
by highend

Code: Select all

    if (<curext> LikeI "lnk") {
        $target = property("#ShortcutTarget", <curitem>);
        if (exists($target) == 2) {
            focus "PI";
            tab("new", $target);
            focus "PI";
        }
    }
?

Re: Open Shortcut Location in Other Pane ?

Posted: 21 Feb 2023 15:45
by GreetingsFromPoland
holy crap! this is amazing. it works perfectly!

in my setup i have a default tab and several other locked tabs. since this script calls tab() with "new", the new tab is created as expected. i'm reading the Scripting Command Reference now to see what would be need to be changed to have it use the Default tab instead of creating a new one.

i'm thinking this will work, but may not be the "correct" way to do it :

Code: Select all

focus "PI";
seltab 1;
tab("relocate", $target);
focus "PI";