The following script adds parent folder name to the selected files:
C:\ExampleFolder\File001.txt ---> C:\ExampleFolder\ExampleFolder - File001.txt
Code: Select all
setting "BackgroundFileOps", 0;
$curBase = gettoken("<curpath>", -1, "\");
foreach($file, "<get SelectedItemsPathNames |>") {
$newName = $curBase . " - " . getpathcomponent($file, "file");
renameitem($newName, $file, , "-01");
}C:\ExampleFolder\File001.txt ---> C:\ExampleFolder\File001 [ExampleFolder].txt
XYplorer Beta Club