“Test Tag” is deleted from OmniFocus entirely, which was certainly a surprise.
In general manipulating task tags seems flaky and weird in ScriptingBridge, despite the fact that it seems to vaguely work in AppleScript. Is this just a bug or is there some subtlety I’m not seeing here?
Are you running in circles with one line of code? You find the object with the tag and remove the tag from the object all in the same line. What happens when you find the objects with the tag, set that result to an object/variable, and then remove the tags from the objects? IOW, use two lines of code.
I’ve tried dozens of variations of this, with temporary variables for various collections of things, different lookups by name, by ID, by index, etc; the result always appears to be the same.
In case anyone else was still wondering: this is a bug in ScriptingBridge, and not (as I now understand it, anyway) in OmniFocus or its scripting support.
So, I tried this out using appscript, whose model much more directly maps to the expected AppleScript verbs, and this example, in addition to being much more brief and clear, also works and doesn’t accidentally destroy tags in the whole DB: