Skip to content

Newly-created tags appear in inconsistent positions in OmniFocus Tags view depending on creation path #23

Description

@MikeNjoroge

Observed

When tags are auto-created during write operations, their position in the OmniFocus Tags view depends on which tool created them:

  • Tags created via add_omnifocus_task with tags=[...] appeared near the top of the Tags view.
  • Tags created via edit_item with add_tags=[...] or replace_tags=[...] appeared near the bottom of the Tags view.

Reproduction

# Creates tags "mcp-test-a" and "mcp-test-b" — observed at top of Tags view
add_omnifocus_task(
    name="Test task",
    project="MCP Sandbox",
    tags=["mcp-test-a", "mcp-test-b"]
)

# Creates tag "mcp-test-c" — observed at bottom of Tags view
edit_item(current_name="Test task", add_tags=["mcp-test-c"])

# Creates tag "mcp-test-final" — observed at bottom of Tags view
edit_item(current_name="Test task", replace_tags=["mcp-test-final"])

(Witnessed live with OmniFocus open in parallel during the operations.)

Expected

Consistent placement regardless of which tool path created the tag. Either always-bottom (matches OmniFocus's UI default when adding a new tag manually) or alphabetical insertion would both be reasonable.

Why it matters

Beyond cosmetics, the inconsistent placement makes it harder to find and clean up test/orphan tags after the fact — you have to scan both ends of the tag tree rather than expecting them in a known location.

Speculation on cause

Without having traced the code paths, the difference suggests add_omnifocus_task and edit_item's tag-handling go through different AppleScript code paths. The tags.py module's generate_add_tags_applescript looks identical in both contexts, so the difference may be in where in the surrounding AppleScript the tag creation happens (e.g., before vs. after the task itself is created and committed).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions