Script to 'Open favorite in other pane'?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
kunkel321
Posts: 664
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Script to 'Open favorite in other pane'?

Post by kunkel321 »

I seem to recall that someone make a script that could do this. It looked and worked like the "Favorite Folders" toolbar item (an Orange star), but when you selected an item, it would get opened in the inactive pane. If the second pane was hidden, it would get shown.

Does anyone know the script?
ste(phen|ve) kunkel
Scaling: Main monitor 125%, Secondary monitor on the right 100%
OS: Win 10. XYplorer version: Latest beta, unless specified.

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: Script to 'Open favorite in other pane'?

Post by klownboy »

The only one that comes to mind is Folder Pane Preview which lets you select a folder in the first pane, and preview its contents on the second pane. viewtopic.php?f=7&t=17968

highend
Posts: 14923
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script to 'Open favorite in other pane'?

Post by highend »

E.g.:

Code: Select all

    $tmpIni = "%TEMP%\~XYplorer.ini";
    savesettings 1, $tmpIni;

    $favorites = getsectionlist("Favorites", $tmpIni);
    $favorites = regexreplace($favorites, "^Count=\d+\r?\n");
    $favorites = regexreplace($favorites, "(^Fav\d+=[""]|[""]$)");
    $favorites = regexreplace($favorites, "^(.+?)$", "$1|$1|$1" . <crlf>);
    end (!$favorites), "No favorite folder(s) defined, aborted!";

    $sel = popupmenu($favorites, 6:=<crlf>, 7:="|");
    if ($sel) {
        if (!get("#800")) { #800; }
        focus "PI";
        goto $sel;
    }
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: Script to 'Open favorite in other pane'?

Post by klownboy »

Hey highend, that was quick. Works fine, but is there any was to make it display the icon in the popupmenu when the Favorite (as seen in manage favorites) has a icon associated with it? For example like these,
"AHK scripts|<xyicons>\ahk.ico" goto "D:\Tools\AutoHotkey\AHKscripts\";

The only icon displaying for me is the one favorite I have that has a folder icon associated with it in "Custom File Icons..." like so,
"Games folder" D:\Games\ /r>D:\Graphics\Icons\puzzle_piece_01.ico|D:\Graphics\Icons\puzzle_piece_02.ico
So in this case the icon is shown in your popupmenu.

Edit: If it's a pain, don't bother. I have another script which I could pull that icon info out to use in this.

highend
Posts: 14923
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script to 'Open favorite in other pane'?

Post by highend »

Something like this?

Code: Select all

    /*
    Normal:
    E:\VB-Don\TestFiles\Media

    Captions:
    "Transparent PNGs" E:\VB-Don\TestFiles\Media\ARGB 32bit\

    Caption with custom icon:
    "caption|[icon spec]" location
    "caption|Kiss.ico" location
    "caption|C:\WINDOWS\notepad.exe" location
    "caption|:dice" location
    "caption|%winsysdir%\shell32.dll /160" location
    */

    // Go to favorite folders in the other pane
    $tmpIni = "%TEMP%\~XYplorer.ini";
    savesettings 1, $tmpIni;

    $tmpFavs = getsectionlist("Favorites", $tmpIni);
    $tmpFavs = regexreplace($tmpFavs, "^Count=\d+\r?\n");
    $tmpFavs = regexreplace($tmpFavs, "(^Fav\d+=[""]|[""]$)");

    $newFavs = "";
    foreach($fav, $tmpFavs, <crlf>, "e") {
        // Has '"' in it
        if (strpos($fav, '"') != -1) {
            $prefix = gettoken($fav, 2, '"', "t");
            $path   = gettoken($fav, 3, '"', "t");

            // Has an icon
            if (strpos($prefix, "|") != -1) {
                $title    = gettoken($prefix, 1, "|", "t");
                $icon     = gettoken($prefix, 2, "|", "t");
                $newFavs .= $title . "|" . $path . "|" . $icon . <crlf>;
                continue;
            }
            $newFavs .= $prefix . "|" . $path . "|" . $path . <crlf>;
        } else {
            $newFavs .= $fav . "|" . $fav . "|" . $fav . <crlf>;
        }
    }
    $newFavs = trim($newFavs, <crlf>, "R");
    end (!$newFavs), "No favorite folder(s) defined, aborted!";

    $sel = popupmenu($newFavs, 6:=<crlf>, 7:="|");
    if ($sel) {
        if (!get("#800")) { #800; }
        focus "PI";
        goto $sel;
    }
One of my scripts helped you out? Please donate via Paypal

kunkel321
Posts: 664
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Script to 'Open favorite in other pane'?

Post by kunkel321 »

highend wrote: 20 Dec 2025 20:28
Amazing! Thanks Highend!!!

EDIT: I attempted to make an icon, using parts from the default icons.
Image
OpenFaveInOtherPane.zip
You do not have the required permissions to view the files attached to this post.
ste(phen|ve) kunkel
Scaling: Main monitor 125%, Secondary monitor on the right 100%
OS: Win 10. XYplorer version: Latest beta, unless specified.

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: Script to 'Open favorite in other pane'?

Post by klownboy »

Thanks from me as well highend. It worked great once I got rid of those goto's I had in with the folder. They been there for a long tine I guess and not needed. And thanks for the icon kunkel321.

admin
Site Admin
Posts: 66075
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Script to 'Open favorite in other pane'?

Post by admin »

Nice, but I did not like to see those if (!get("#800")) { #800; } lines. The next beta (32/64) gives you a new function for it.

highend
Posts: 14923
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script to 'Open favorite in other pane'?

Post by highend »

Don, your syntax description for dualpane [show], [active] in the changelog isn't correct, it's a function, not a command as all the given examples show
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66075
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Script to 'Open favorite in other pane'?

Post by admin »

Oops, thx!

Post Reply