Page 1 of 1

Creating Tasks in Omnifocus

PostPosted: Wed Nov 02, 2022 4:32 pm
by snpower
I am trying to modify David Spark's hazel rule which contains AppleScript to create tasks in OmniFocus. Basically I just want to have Hazel process a document and send it to OF; however I keep getting an "applescript failed message". Help appreciated; I'm not a scripting expert by any means!!

This is the log entry (in part):

2022-11-02 07:16:58.027 hazelworker[26798] DEBUG: Skipped /Users/stephenpower/Downloads/OmniFocus-3.14.dmg. File/folder not part of change set/file event.
NSLocalizedDescription = "OmniFocus got an error: Can\U2019t get flattened tag 1 of document 1 whose name = \"Financial\". Invalid index.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,8e28e2 \"OmniFocus\"]>";
OSAScriptErrorAppNameKey = OmniFocus;
OSAScriptErrorMessageKey = "OmniFocus got an error: Can\U2019t get flattened tag 1 of document 1 whose name = \"Financial\". Invalid index.";
NSLocalizedDescription = "OmniFocus got an error: Can\U2019t get flattened tag 1 of document 1 whose name = \"Financial\". Invalid index.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,8e28e2 \"OmniFocus\"]>";
OSAScriptErrorAppNameKey = OmniFocus;
OSAScriptErrorMessageKey = "OmniFocus got an error: Can\U2019t get flattened tag 1 of document 1 whose name = \"Financial\". Invalid index.";

This is the rule (so far) in Hazel:
Image

Re: Creating Tasks in Omnifocus

PostPosted: Thu Nov 03, 2022 10:05 am
by Mr_Noodle
That seems to be an issue with the script. Try the script outside of Hazel and debug it there.