Add profiles functionality to favorites
-
mr9bitbyte
- Posts: 1
- Joined: 10 Nov 2023 15:26
Add profiles functionality to favorites
I love the favorite folder/files. But I often use them for specific projects and changed them based on a project that I find myself going back to. It'd be nice to have the option to have different "profiles" in which a group of favorite files or folders are loaded depending on the profile used, if you are working on a different project, you can change the favorite files/folders being used depending on the profile selected. I think this would be a very useful functionality.
-
admin
- Site Admin
- Posts: 65390
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Add profiles functionality to favorites
a) Check out the command line switch /ini in the Help file.
OR
b) Check out the scripting command loadsettings.
OR
b) Check out the scripting command loadsettings.
FAQ | XY News RSS | XY X
Re: Add profiles functionality to favorites
I support mr9bitbyte's wish.
/ini parameter or scripting makes things too complicated.
1. Different ini-files would mean, all other setting changes must be made in all ini-files.
2. Loadsettings doesn't allow to just load new favorites.
/ini parameter or scripting makes things too complicated.
1. Different ini-files would mean, all other setting changes must be made in all ini-files.
2. Loadsettings doesn't allow to just load new favorites.
Windows 11 Home, Version 25H2 (OS Build 26200.7462)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Re: Add profiles functionality to favorites
The script solution with toggling 2 sets is fine for normal usage
but not applicable for project management related favs.
Who has only 2 projects ?
but not applicable for project management related favs.
Who has only 2 projects ?
Windows 11 Home, Version 25H2 (OS Build 26200.7462)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Re: Add profiles functionality to favorites
The link was to a post mentioning that the scripting command is already available, demoing that users can already script XY to load any number of different sets of favorites, no one is forcing you to to use that pre-made script.
Re: Add profiles functionality to favorites
Unlimited profiles...
Code: Select all
$dst = "<xydata>\Favorites";
if (exists($dst) != 2) { new($dst, "dir"); }
$favFiles = listfolder($dst, "*.txt", 1+4, <crlf>);
$mouseBtn = <get trigger mousebtn>;
// Left click (load profile)
if ($mouseBtn == 1) {
end ($favFiles == ""), "No profile(s) yet, aborted!";
$menu = replace($favFiles, ".txt");
$sel = popupmenu($menu, 6:=<crlf>);
if ($sel) {
$cntFiles = 0;
$cntFolders = 0;
$favFile = $sel . ".txt";
$content = readfile("$dst\$favFile", , , 65001);
$files = regexmatches($content, "^\[Files\](\s|\S)+?^\[");
if ($files) {
$files = trim(regexreplace($files, "^\[.*?(\r?\n|$)"), <crlf>);
$cntFiles = gettoken($files, "count", <crlf>);
favs("f", $files, , "s");
}
$folders = regexmatches($content, "^\[Folders\](\s|\S)+");
if ($folders) {
$folders = trim(regexreplace($folders, "^\[.+?\](\r?\n)"), <crlf>);
$cntFolders = gettoken($folders, "count", <crlf>);
favs("d", $folders, , "s");
}
if ($files == "" && $folders == "") {
status "No favorites in profile, aborted!", "8B4513", "stop";
end true;
}
status ($cntFiles + $cntFolders) . " favorites loaded from " . quote($sel);
}
// Right click (save profile)
} elseif ($mouseBtn == 2) {
// Show all existing profile (files) and one entry to create a new one
$favFiles = replace($favFiles, ".txt");
$menu = "Save as a new profile";
if ($favFiles != "") { $menu .= <crlf> . "-" . <crlf> . $favFiles; }
$files = favs("f");
$folders = favs("d");
end ($files == "" && $folders == ""), "No favorites defined, aborted!";
$sel = popupmenu($menu, 6:=<crlf>);
if ($sel == "Save as a new profile") {
$fileName = input("Enter filename, WITHOUT extension!", , "Work");
end ($fileName == ""), "Empty name entered, aborted!";
$fileName .= ".txt";
step; // DEBUG
if (exists("$dst\$fileName") == 1) {
if !(confirm("Profile already exists, overwrite?", , , 1+32)) { end true; }
}
WriteFavFile("$dst\$fileName", $files, $folders);
} elseif ($sel != "") {
$fileName = $sel . ".txt";
WriteFavFile("$dst\$fileName", $files, $folders);
}
}
function WriteFavFile($file, $favFiles, $favFolders) {
$content = "[Files]" . <crlf> . $favFiles . <crlf 2> . "[Folders]" . <crlf> . $favFolders;
writefile($file, $content, , "utf8");
}
One of my scripts helped you out? Please donate via Paypal
Re: Add profiles functionality to favorites
That's clear, but there are too many basic functions which can only be solved by additional scripting.
For me, this is a typical example where Don should make an integrated solution.
Windows 11 Home, Version 25H2 (OS Build 26200.7462)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Re: Add profiles functionality to favorites
Windows 11 Home, Version 25H2 (OS Build 26200.7462)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1404a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
XYplorer Beta Club