Hello, the following code gets an
application error and I don’t know why? The OmniFocus Applescript dictionary says the id is a settable attribute. I suspect I don’t understand variable scoping or something in Applescript. :-). Thanks for any help
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "OmniFocus"
tell default document
set theTask to (make new inbox task with properties {name:"Test Name", note:"Tra la la"})
set id of theTask to "testing" -- this fails, why?
end tell
end tell
Here is the error
And this variation fails in a different way:
tell theTask
set id to (string tHash) -- why does this fail?
end tell
And of course, this code works fine:
if tDate ≠ "" then
set due date of theTask to tDate
end if
Thank you for your help.