I found the code below here in the forum and it is very close to something that I would like. I tried plugging in the stuff that I am trying to do, but I am not having any luck.
Thank you for any help that you can provide.
Code: Select all
foreach($item, "<get SelectedItemsPathNames |>") {
if (exists($item) == 2) { $baseName = getpathcomponent($item, "file"); $ext = ""; } // Folder
else { $baseName = getpathcomponent($item, "base"); $ext = "." . getpathcomponent($item, "ext"); } // File
if (regexmatches($baseName, "-SAVE$") != "") { // Contains "-SAVE"
$newName = regexreplace($baseName, "-SAVE$");
copyitem $item, "<curpath>\" . $newName . $ext;
} else { // Does not contain "-SAVE"
renameitem($baseName . "-SAVE" . $ext, $item);
}
}
XYplorer Beta Club