In testing, when I select four files and run this, I get four separate messages with the correct tags that I want to apply to each. So echo1 is the tag for file1, and echo2 is the tag for file2, and so on.
Code: Select all
foreach($file, <get SelectedItemsPathNames <crlf>>, <crlf>, "e") {
$filename = getpathcomponent($file, "base");
$filter1 = gettoken($filename, 5,".");
$filter2 = gettoken($filename, 6,".");
$tag = $filter1.".".$filter2;
echo $tag;
}But, when I change the last line to this, it applies the last tag to all of the selected items. I've tried leaving the <curitem> spot empty. I tried the tagitems() command with the fiels set to "tags" but that didn't seem to work any differently.
Code: Select all
tag $tag,<curitem>,1,1;
XYplorer Beta Club