Just sharing this simple script I have been using with great satisfaction. It lets you work with a preset menu of paths that you frequently access and gives you a choice of operations: Go to, Copy or Move. In the latter 2 cases, the operation will work on any items you select in the List. The script has an example menu of paths with separators and a sub menu.
Before I created this script, I was using the Favorite Folders and Recent File Operations menus. But the Recent File Operations menu is dynamically created from the Action log and common paths I use wouldn't necessarily stay there. And Favorite Folders is often slow to popup on my system because most of the paths I use are on external drives which might be asleep. (Don had made improvements to address this, but it's still problematic for me.) Recent File Operations can also be slow to popup sometimes too.
Code: Select all
// This script pops up a menu of destinations and actions (Move, Copy or Go To),
// then performs the chosen operation for the chosen destination
// using selected items if relevant.
// [Created by XYplorer forum Jerry]
//==================================================================
// Define your preset destinations here:
$destinations = <<<#---MENU_END
Downloads
Documents
Desktop
-
Windows System Folders
%appdata%
%localappdata%
%temp%
%programfiles%
%programfiles(x86)%
#---MENU_END;
//==================================================================
// Check for selected items
$selcount = gettoken(<selitems |>, "count", "|");
// Ask for Action
$action = popupmenu("Go To|Copy|Move");
if ($action == "") { end 1; } // user cancelled
if ($action == "Go To") {
$selcountDisplay = ""
} else {
$selcountDisplay = " (" . $selcount . " items)"
}
// Require selected items if necessary
if ($action != "Go To") {
if ($selcount == 0) {
msg "You must select one or more items for the chosen operation ($action).";
end 1==1;
}
}
// Build menu of destination names, include the $action with item count as a disabled header
$menu = recase($action, "upper") . $selcountDisplay . ";;;4<crlf>-<crlf>" . $destinations;
// Show menu of destinations
$choice = popupnested($menu);
if ($choice == "") { end 1; } // user cancelled
$dest = trim($choice);
if ($action == "Go To") {
goto $dest;
end 1==1;
}
// Perform the operation on selected items
if ($action == "Move") {
moveto $dest, <get SelectedItemsPathNames |>;
} elseif ($action == "Copy") {
copyto $dest, <get SelectedItemsPathNames |>;
}
XYplorer Beta Club
