//check: better handling of 'access denied' folders (from sc listfolder\or exists?)... $maxIT = 50; //max of folders reported per folder; the lower, the faster; DEFAULT: 50 $maxLVL = 4; //max depth for recursion - only the DEEPEST [last folder] *WITHIN* ( >= ) this value will be listed; the greater, the slower; DEFAULT: 4 [optimal value]; minimum: 3 (lower values will be auto-fixed) $maxDST = 50; //threshold for items at destination; if this is reached, an extra GOTO filter will pop [aka 'teleporter']; DEFAULT: 50 $warn = "<_______________________ ***TRIMMED!"; $forbidden = "System Volume Information|found.0|$RECYCLE.BIN"; // '|' (pipe)-separated list of terms which are forbidden to be found, generally system folders if($maxLVL < 3) { $maxLVL = 3; } else { } $cp = ""; $tst = gettoken("$cp", count, "\"); $names = <<<>>> Downloads|{374DE290-123F-4565-9164-39C4925E467B} Saved_Games|{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4} AppData Cache Cookies Desktop Favorites History Local_AppData My_Music My_Pictures My_Video NetHood Personal Programs Recent SendTo Start_Menu Startup Templates >>>; $w = get("screen", "width"); $h = get("screen", "height"); $fW = $w \ 10; $fH = $h \ 10; $fW = $w - $fW*4; $fH = $h - $fH; $tt = gettoken("$names", count, ""); $mru = get("list_recentlocations"); $re = ""; $re3 = ""; $re4 = ""; $re2 = listfolder("$cp", , 2, ""); while ($opL < $maxLVL -1) { $opL++; //_________________________________________________________________________ START of *controlled recursion* foreach($tk, "$re2", ) { foreach($tk2, "$forbidden", "|") { $tst = strpos("$tk", "$tk2"); if($tst != "-1") { break 2; } else { } } if($tk == "$warn") { $lvl = "$warn"; } elseif($tk == "") { continue; } else { $lvl = listfolder("$tk", , 2, ""); if ($lvl == "") { $re3 = $re3 . $tk . ; continue; } else { } } $tst = gettoken("$lvl", count, ); if($tst >= $maxIT) { $lvl = gettoken("$lvl", $maxIT, , , 1) . . "$warn"; } else { } if($lvl == "") { $re3 = $re3 . $tk . ; continue; } else { } // step; // $re3 = $re3 . $tk . ; text $re3; wait 500; $re4 = $re4 . $lvl . ; $opX++; } $re2 = ""; $re2 = $re4 . ; $re4 = ""; } $re3 = "$re3" . "|| *** SIBLINGS *** ||" . listfolder("$cp", , 2, ""); //_________________________________________________________________________ end of *controlled recursion* $dwn = trim($re3, ); $upcp = gettoken("$cp", "-2", "\", , 1); if("$upcp" == "") { $upcp = "c:"; } else { } $sis = listfolder("$upcp", , 2, ""); } $prnt = gettoken("$upcp", "-2", "\", , 1); if ("$prnt" == "") { } else { $prnt = listfolder("$prnt", , 2, ""); } if("$sis" LikeI "$dwn") { $dwn = ""; } else { } $list = "$names" . "" . "|| ^^^BUTTON: drives^^^ ||" . "" . "|| ^^^BUTTON: HOTLIST^^^ ||" . "" . "|| ^^^BUTTON: Most Recently Used^^^ ||" . "_________________________________________" . "|| *** UPPER *** ||" . "$prnt" . "" . "*" . "" . "|| *** NEIGHBORS *** ||" . "$sis" . "" . "%desktop%" . "" . "|| *** DEEPER {{ deepest only! - $maxLVL levels }} *** ||" . "$dwn" . "|| *** RECENT *** ||" . "$mru"; $in = inputselect("[ press TAB to focus filter box! ] [[ Filters: '|' (all labels) ]] Select the item you'd like to GO TO:", "$list", "", "129", , $fW, $fH, "dynaBushes by SkyFrontier"); if($in <= $tt) { $goto = gettoken("$names", "$in", ""); $regKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"; $name = regexmatches($names, "^" . $goto . ".*?(?=$)"); $regName = (gettoken($name, 2, "|") != "") ? gettoken($name, 2, "|") : replace($name, "_", " "); $path = regexmatches(runret("reg query ""$regKey"" /v ""$regName"""), "([A-Z]:|%[^%]+%)\\.*?(?=$)", 1); tab("new"); goto eval("""$path"""); end 1; } elseif($in == $tt + 1) { tab("new"); button("drives", "1"); end 1; } elseif($in == $tt + 2) { tab("new"); button("hotlist", "1"); end 1; } elseif($in == $tt + 3) { tab("new"); button("mru", "1"); end 1; } else { $in = gettoken("$list", "$in", ""); end ($in == ""); $tst = exists("$in"); if($tst == "1") { run """$in"""; } elseif($tst == "2") { foreach($tk2, "$forbidden", "|") { $tst = strpos("$in", "$tk2"); if($tst != "-1") { end 1, "Forbidden!"; } else { } } $tst = listfolder("$in", , 32); if($tst > $maxDST) { $list = listfolder("$in"); $in = inputselect("[ press TAB to focus filter box! ] There are more than $maxDST items in the target. Beam you down to...", "$list", "|", "32", , $fW, $fH, "dynaBushes' TELEPORTER by SkyFrontier"); } tab("new"); goto """$in"""; } //alternatively tries to GO TO item anyway: necessary for "*" - myComputer, for instance else { end ($in == $warn), "d'oh.You REALLY picked the warning message???"; $tst = strpos("$in", "|"); end ($tst != "-1"), "Have you selected a label?Bye!"; $regKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"; $name = regexmatches($names, "^" . $in . ".*?(?=$)"); $regName = (gettoken($name, 2, "|") != "") ? gettoken($name, 2, "|") : replace($name, "_", " "); $path = regexmatches(runret("reg query ""$regKey"" /v ""$regName"""), "([A-Z]:|%[^%]+%)\\.*?(?=$)", 1); tab("new"); goto eval("""$path"""); }