This works for creating a task with an assigned project:
tell application "OmniFocus"
tell default document
set theProject to first flattened project where its name = "Project Name"
make new inbox task with properties {name:"Task Name", note:"Task Note", assigned container:theProject}
end tell
end tell
But this fails:
tell application "OmniFocus"
tell default document
set theProject to first flattened project where its name = "Project Name"
tell quick entry
make new inbox task with properties {name:"Task Name", note:"Task Note", assigned container:theProject}
open
end tell
end tell
end tell
The error is “Attempted to mix self with an object from another document.”. The “set theProject” line doesn’t work if it’s inside the “tell quick entry” block.
Not sure where to go from here, any ideas?