Page 1 of 1
Script to 'Open favorite in other pane'?
Posted: 20 Dec 2025 17:50
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?
Re: Script to 'Open favorite in other pane'?
Posted: 20 Dec 2025 18:50
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
Re: Script to 'Open favorite in other pane'?
Posted: 20 Dec 2025 18:58
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;
}
Re: Script to 'Open favorite in other pane'?
Posted: 20 Dec 2025 19:32
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.
Re: Script to 'Open favorite in other pane'?
Posted: 20 Dec 2025 20:28
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;
}
Re: Script to 'Open favorite in other pane'?
Posted: 20 Dec 2025 21:14
by kunkel321
Amazing! Thanks Highend!!!
EDIT: I attempted to make an icon, using parts from the default icons.
OpenFaveInOtherPane.zip
Re: Script to 'Open favorite in other pane'?
Posted: 21 Dec 2025 00:50
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.
Re: Script to 'Open favorite in other pane'?
Posted: 21 Dec 2025 10:57
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.
Re: Script to 'Open favorite in other pane'?
Posted: 21 Dec 2025 12:06
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
Re: Script to 'Open favorite in other pane'?
Posted: 21 Dec 2025 12:11
by admin
Oops, thx!