Code: Select all
/*
******************************************************************************
@Author : IT Services & Consulting Ulf Kohlmorgen
@Created : 2022-01-14 20:03:13
@Modified: 2022-01-14 20:09:47
@Function: Copyto, moveto, backupto to tab folders with path
@Tags : <empty>
@Version : v0.1e
******************************************************************************
*/
$iconFolder = ":showfolders";
$iconCopy = ":copyto";
$iconMove = ":moveto";
$iconBackup = ":backupto";
$selectedItems = <get SelectedItemsPathNames |>;
end (!$selectedItems), "No item(s) selected, aborted!";
$folders = "";
if (get("#800")) { $folders .= get("tabs", <crlf>, "i"); }
$folders .= <crlf> . get("tabs", <crlf>);
$folders = formatlist($folders, "esdF", <crlf>, "!" . <curpath>);
$menu = "";
$indent = <space 4>;
$last = "";
while ($folders) {
$folder = gettoken($folders, 1, <crlf>);
$folders = gettoken($folders, 2, <crlf>, , 2);
if ($folder != $last) {
$caption = gpc($folder, "component", -1);
$menu .= <crlf> . $caption . "<:><:>" . $iconFolder;
}
$path = input("Paste with path Edit: ","$selectedItems",<curitempath>,"", , 800, 171);
$path = replace($path,:,);
$indent = <space 4>;
$menu .= <crlf> . $indent . "Copy <selected items> here...<:>" . $path . "<:>" . $iconCopy;
$menu = "";
$indent = <space 4>;
$last = "";
while ($folders) {
$folder = gettoken($folders, 1, <crlf>);
$folders = gettoken($folders, 2, <crlf>, , 2);
if ($folder != $last) {
$caption = gpc($folder, "component", -1);
$menu .= <crlf> . $caption . "<:><:>" . $iconFolder;
}
$data = 'copyto ' . "'$folder" . "\" . "$path'","$selectedItems", , 2, 2;
$menu .= <crlf> . $indent . "Copy with Path <selected items> here...<:>" . $data . "<:>" . $iconCopy;
$data = 'moveto ' . "'$folder" . "\" . "$path'","$selectedItems", , 2, 2;
$menu .= <crlf> . $indent . "Move with Path <selected items> here...<:>" . $data . "<:>" . $iconMove;
$data = 'backupto ' . "'$folder" . "\" . "$path'","$selectedItems", , 2, 2;
$menu .= <crlf> . $indent . "Backup with Path <selected items> here...<:>" . $data . "<:>" . $iconBackup;
$last = $folder;
}
$selection = popupnested($menu, 6:=<crlf>, 7:="<:>");
if ($selection) { load $selection, , "s"; }
Copyto, moveto, backupto to tab folders [edit path then paste with path without asking]
Code: Select all
/*
******************************************************************************
@Author : IT Services & Consulting Ulf Kohlmorgen
@Created : 2022-01-14 20:03:13
@Modified: 2022-01-15 09:23:06
@Function: Copyto, moveto, backupto to tab folders with path without asking
@Tags : <empty>
@Version : v0.1e2
******************************************************************************
*/
$iconFolder = ":showfolders";
$iconCopy = ":copyto";
$iconMove = ":moveto";
$iconBackup = ":backupto";
$selectedItems = <get SelectedItemsPathNames |>;
end (!$selectedItems), "No item(s) selected, aborted!";
$folders = "";
if (get("#800")) { $folders .= get("tabs", <crlf>, "i"); }
$folders .= <crlf> . get("tabs", <crlf>);
$folders = formatlist($folders, "esdF", <crlf>, "!" . <curpath>);
$path = input("Paste with path Edit:","$selectedItems" ,<curitempath>,"" , , 800, 171);
$path = replace($path,:,);$path = replace($path,$path,"\$path");
$menu = "";
$indent = <space 4>;
$last = "";
$roots = "Copyto|moveto|backupto";
foreach($root, $roots, , "e") {
$tmpFolders = $folders;
switch (recase($root)) {
case "copyto" : $menu .= <crlf> . "Copy <selected items> here..." . "<:><:>" . $iconCopy; break;
case "moveto" : $menu .= <crlf> . "Move <selected items> here..." . "<:><:>" . $iconMove; break;
case "backupto": $menu .= <crlf> . "Backup <selected items> here..." . "<:><:>" . $iconBackup; break;
}
while ($tmpFolders) {
$tmpFolder = gettoken($tmpFolders, 1, <crlf>);
$tmpFolders = gettoken($tmpFolders, 2, <crlf>, , 2);
if ($tmpFolder != $last) {
$caption = gpc($tmpFolder, "component", -1);
}
$data = $root. " " . quote($tmpFolder . $path) . ", " . quote($selectedItems) . ", , 2, 2;";
$menu .= <crlf> . $indent . $tmpFolder . "<:>" . $data . "<:>" . $iconFolder;
$last = $tmpFolder;
}
}
$selection = popupnested($menu, 6:=<crlf>, 7:="<:>");
if ($selection) { load $selection, , "s"; }