Middle Click Launcher - need help.
Posted: 29 Oct 2021 10:54
i made a script for myself that is launched via CEA middle-click, searching trough folders and its subs, showing menu with list of all found exes.
Then i wanted to modify it in few ways and got stuck.
1) I'd wish script to somehow remember which exe i did select last time and sort that on top of list/menu, but realization..
1.1) Use permanent variable and store all selected exes there, checking each time and sorting menu if token is found - but obviously at some point variable will reach it's limit(though i'm not sure what is the exact limit).
1.2) Use labels, marking all selected exes with special label and checking on search for menu - but that will start to fill system with basically useless labelled files here and there.
2) As some folders have quite deep nested structure, forming of menu takes some seconds, and I'd wish to add some "caсhe"-ability, to not mess with searching each time and simply take data from "cache" - but this idea again "crashes" with variable(permanent) limits, that would be overflown fast, if storing whole lists of exes.
Not asking to write some code, just any ideas and thoughts would be appreciated.
Code: Select all
$exe = ""; $run = ""; $list = "";
$list = quicksearch("*.exe","<selitem>","|");
foreach($token, $list, "|") {
$exe = $exe . $token . ";" . $token . ";" . $token . "|";
}
if ($list != "") {$run = popupmenu(trim($exe, "|", "R"));} //trim() deletes one very last | added in foreach
else {end};
if ($run != "") {run quote($run);}1) I'd wish script to somehow remember which exe i did select last time and sort that on top of list/menu, but realization..
1.1) Use permanent variable and store all selected exes there, checking each time and sorting menu if token is found - but obviously at some point variable will reach it's limit(though i'm not sure what is the exact limit).
1.2) Use labels, marking all selected exes with special label and checking on search for menu - but that will start to fill system with basically useless labelled files here and there.
2) As some folders have quite deep nested structure, forming of menu takes some seconds, and I'd wish to add some "caсhe"-ability, to not mess with searching each time and simply take data from "cache" - but this idea again "crashes" with variable(permanent) limits, that would be overflown fast, if storing whole lists of exes.
Not asking to write some code, just any ideas and thoughts would be appreciated.