Trying to create a script to check to see if TagA is present, if so remove.
Any help would be appreciated.
I know nothing about scripting and have tried to modify a few different replace tag actions in the directory but keep running into errors and am not sure what the problem is.
Below is what I’ve come up with which doesn’t work…
// remove taga
if (con) {
var items = Draft.query("", “all”, “taga”)
for (var item of items) {
item.removeTag(“taga”);
item.update();
}
}
else {
context.cancel
}
When I post examples, where possible, I try and post something that will get not just the poster to the answer but also offer wider options for other readers too who may be looking for something similar but not quite the same. That’s all.
But doing things like pulling out the tag as a separate variable near the top of the script can be useful for maintenance and potential re-use if you say turned the tag removal into a function call instead.
Oh hey, look at that! I keep usernames smaller than actual names in Icro, so I didn’t make the connection. Fun running into you here as well, and funny that I did end up finding a way around your problem in the end.