Hey there. I’m tiring to add a task to a project in Omnifocus from an App called Tinderbox. Here is the AppleScript I have, but I can’t seem to get it to work (I don’t know a lot about AppleScript and even less about Omnifocus).
tell application "Tinderbox 9"
tell front document's selection
set theTask to name
set noteURL to value of (attribute named "NoteURL")
set theProjiD to value of (attribute named "OmniProjID")
set startDate to value of (attribute named "StartDate")
set endDate to value of (attribute named "EndDate")
end tell
end tell
tell front document of application "OmniFocus"
set theProject to first flattened task where its name = theProjiD
set theTask to make new task with properties {name:theTask, note:noteURL, context:theProject}
set omniTaskID to id of theTask
end tell
tell application "Tinderbox 9"
tell front document's selection
set value of (attribute named "Badge") to "link"
set value of (attribute named "Color") to "poppy"
set value of (attribute named "KeyAttributes") to "URL;"
set value of (attribute named "URL") to ("omnifocus:///task/" & omniTaskID)
end tell
end tell
Can someone help me fix this? How do I tell Omnifocus which project to add a new task to?