How to get tags in batch rename?
How to get tags in batch rename?
I want to add tags to my filenames in batch, because not all computers have xyplorer. So can I get the tags of the files from a script in "special rename -> batch rename "? Something like <date yyyy-mm-dd>, just use <tag>.
Re: How to get tags in batch rename?
No, that variable isn't supported in that context.
You would need to loop over all selected items, read the tags and rename the item with that info...
E.g.:
You would need to loop over all selected items, read the tags and rename the item with that info...
E.g.:
Code: Select all
// Rename items by adding their tags
setting "BackgroundFileOps", 0;
foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
$base = gpc($item, "base");
$ext = gpc($item, "ext");
$tags = tagitems("tags", , $item);
if ($tags) {
$tags = regexreplace($tags, "(<|>|:|""|/|\\|\||\?|\*)", "_");
$name = $base . " - " . $tags;
if (exists($item) == 1) { $name .= "." . $ext; }
renameitem($name, $item);
}
}
One of my scripts helped you out? Please donate via Paypal
XYplorer Beta Club