If the script is invoked whilst holding
Shift - Sorted menu
Ctrl - HotList
Ctrl+Shift - HitList
None/Others - Recent Menu
After the menu is displayed, if the menu items are clicked whilst holding
Ctrl - Copies selected item to the clicked directory
Shift - Moves selected item to the clicked directory
None/Others - Goto the selected item
Why not Alt - Alt misbehaves on context menus
Code: Select all
"HitList"
$mod = get("shift");
$limit = 32;
$order = "Recent"; //No (or any other) modifier keys
If ($mod == 1) { $order = "Sorted"; } //Shift
ElseIf ($mod == 2) { $order = "HotList"; } //Ctrl
ElseIf ($mod == 3) { $order = "HitList"; } //Ctrl+Shift
$CleanList = "";
if ($order == "Recent" || $order == "Sorted") {
$count = 0;
foreach($RecPath, get("list_recentlocations"), <crlf>,, "") {
if ($count < $limit) {
if (substr($RecPath,0,2) == "\\") { $flag=1; } //Assume Network paths are available
Else { $flag = exists($RecPath) ; }
if ($flag > 0) {
$count++;
$CleanList = $CleanList . '"' . format($count,"00") . " - $RecPath|$RecPath" . '"' . " Act($RecPath);" . "<crlf>";
}
} else { break; }
}
} else {
$PrevPath = "" ;
if ($order == "HotList" ) {
$RecLoc = formatlist(get("list_recentlocations"),"s","<crlf>") ;
} else {
$RecLoc = get("list_recentlocations") ;
}
foreach($RecPath,$RecLoc , <crlf>,r, "") {
If (substr($RecPath,0,2) == "\\" ) { $flag=1; }
Else { $flag = exists($RecPath) ; }
If ($flag > 0) {
$Check = Replace($PrevPath,$RecPath,"",) ;
if ($Check == $PrevPath ) {
$CleanList = $CleanList . '"' . "$RecPath|$RecPath" . '"' . " Act($RecPath);" . "<crlf>";
}
$PrevPath = $RecPath ;
}
}
}
$CleanList = formatlist($CleanList,"e","<crlf>");
if ($order != "Recent") {
if ($order == "Sorted") {
$CleanList = RegExReplace ($CleanList,"\d+ - (.+)","$1") ;
}
$Sorted = formatlist($CleanList,"s","<crlf>");
$CleanList = "";
$LastLetter = substr($Sorted,1,1);
foreach($path, $Sorted, <crlf>,, "") {
if ($LastLetter != substr($path,1,1)) {
$CleanList = $CleanList . "-" . <crlf>;
}
$LastLetter = substr($path,1,1);
$CleanList = $CleanList . $path . <crlf>;
}
}
load "$CleanList", * , 's';
function Act($loc)
{
$mod = <get shift>;
If ($mod == 2) { //Ctrl
CopyTo $loc ;
}
ElseIf ($mod == 3) { //Ctrl+Shift
MoveTo $loc ;
}
Else { //No (or any other) modifier keys
GoTo $loc ;
}
}