pip install pyobjc, and creating a task called “test task” and a tag called “Test Tag”, I tried this:
from ScriptingBridge import SBApplication from Foundation import NSURL omniFocus = SBApplication.applicationWithURL_( NSURL.URLWithString_("file:///Applications/OmniFocus.app") ) doc = omniFocus.documents() doc.inboxTasks().objectWithName_("test task").tags().removeObject_(doc.tags().objectWithName_("Test Tag"))
and nothing happened. If instead, I do this:
doc.inboxTasks().objectWithName_("test task").tags().removeObjectWithID_(doc.ta gs().objectWithName_("Test Tag").id())
“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?