Skip to content

Bug: task update --project fails for inbox tasks with JXA error -10000 #3

Description

@yy

Summary

Moving an inbox task to a project via ofocus task update <id> --project <project> consistently fails with:

Error: JXA error: execution error: Error: Error: AppleEvent handler failed. (-10000)

Other updates on the same task (--flag, --note, --name) succeed, so the task reference resolves correctly. Only the --project assignment fails.

Reproduction

  1. Create a new project inside an existing folder:
    ofocus project create "HUFL household data" --folder "Urban science"
    # → id: akTq1ik9d-S
  2. Pick an inbox task id (e.g. pwyeARZ8Xyk) via ofocus inbox --json.
  3. Try any of these — all fail with the same error:
    ofocus task update pwyeARZ8Xyk --project akTq1ik9d-S
    ofocus task update pwyeARZ8Xyk --project akTq1ik9
    ofocus task update pwyeARZ8Xyk --project "HUFL household data"
  4. But these succeed on the same task:
    ofocus task update pwyeARZ8Xyk --flag          # Updated
    ofocus task update pwyeARZ8Xyk --note "..."    # Updated

The project itself is valid — ofocus project ls "Urban science" lists it.

Verified the task stays in the inbox (project: null) after each failed attempt.

Context

  • macOS: 15.5 (Darwin 25.5.0)
  • OmniFocus: 4 (current)
  • Fresh project creation + inbox-task reassignment. The project was created in the same session a few seconds prior.

Likely cause

The current JXA path (src/ofocus/commands/task.py lines 180–192) uses:

projLookup.match.tasks.push(task);

to move the task. With OmniFocus 4's JXA surface, .tasks.push() on a project has been flaky for inbox-originated tasks — -10000 is the generic "AppleEvent handler failed" and is commonly what OF returns when the sender/receiver container relationship can't be resolved for inbox tasks specifically.

Possible alternatives worth trying:

  • app.moveTasks([task], {to: projLookup.match.tasks.beginning}) (or .ending)
  • Setting task.assignedContainer = projLookup.match then task.inInbox = false
  • app.move(task, {to: projLookup.match})

moveTasks is generally the documented way to reassign and seems to work for inbox → project reliably.

Workaround

Drag the task in the OmniFocus UI.

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