Code: Select all
$allItems = <get ItemsNames>;
$indexDst = gettokenindex(gpc(<selitem>, "file"), $allItems, <crlf>, "i") - 1;
foreach($folder, <get SelectedItemsNames <crlf>>, <crlf>, "e") {
if (exists("<curpath>\$folder") != 2) { continue; }
$dst = gettoken($allItems, $indexDst, <crlf>);
if (exists("<curpath>\$dst") != 2) { end true; }
$newName = gettoken($folder, 2, " - ", "t", 2);
if (exists("<curpath>\$dst\$newName") == 2) { end true; }
rename "l", "<curpath>\$dst\$newName", , "<curpath>\$folder";
}
Code: Select all
$allItems = <get ItemsNames>;
$indexDst = gettokenindex(gpc(<selitem>, "file"), $allItems, <crlf>, "i") - 1;
$dst = gettoken($allItems, $indexDst, <crlf>);
foreach($folder, <get SelectedItemsNames <crlf>>, <crlf>, "e") {
if (exists("<curpath>\$folder") != 2) { continue; }
if (exists("<curpath>\$dst") != 2) { end true; }
$newName = gettoken($folder, 2, " - ", "t", 2);
if (exists("<curpath>\$dst\$newName") == 2) { end true; }
rename "l", "<curpath>\$dst\$newName", , "<curpath>\$folder";
}