![]() |
Find a task containing
I've got a mail rule/applescript that parses incoming emails from our online help desk notification system and creates new actions in OmniFocus. I've got this working fine. (I'm converting from previous iCal todo based workflow and am new to OmniFocus)
The help desk also sends email notifications when help requests are completed-- I'd like to have a rule/applescript that finds the action tied to that help request and mark it completed. They will contain the unique incident ID in the form "Incident ID:xxx " The code I'm looking at is something like:[LIST=1][*]set theIncidentID to "Incident ID:30586 "[*]tell default document[*]set theTask to (the first action whose name contains theIncidentID)[*]set completed of theTask to true[/LIST] Unfortunately the 3rd line doesn't work or find anything. Can anyone please give me a pointer on how to find and action/object that contains a certain text string? I suspect I need to access the data differently than I did in iCal todos.... Thanks! |
I haven't done as much OmniFocus scripting as I have with our other products, so I don't know the answer off the top of my head. If you send an email to the [EMAIL="omnifocus@omnigroup.com"]support ninjas[/EMAIL], though, they can knock on the appropriate doors and get this answered for you.
|
OF's scripting interface doesn't allow mass access to actions from the top level. You have to manually write functions to recursively "walk" down the tree of folders, projects, and action groups. See [URL="http://www.rose-hulman.edu/~clifton/software.html"]my Verify Next Actions Exist[/URL] for an example of code that walks these trees.
Be warned that programmatically searching for actions like this is really slow, because your script has to send a large number of Apple Events. It would be great to get a more powerful scripting interface so one could write things like [code] set theTasks to every task whose name contains "TPS Repoort" [/code] Use Help → Send Feedback to submit feature requests. |
Maybe better to sync with ical...
Hmm.. it might be more efficient to sync with ical and use my "Completed Items" script/mailrule to mark the iCal todo complete, then fire off a Sync with iCal call to Omnifocus.
Thanks for the info! [QUOTE=curt.clifton;67353]OF's scripting interface doesn't allow mass access to actions from the top level. You have to manually write functions to recursively "walk" down the tree of folders, projects, and action groups. See [URL="http://www.rose-hulman.edu/~clifton/software.html"]my Verify Next Actions Exist[/URL] for an example of code that walks these trees. Be warned that programmatically searching for actions like this is really slow, because your script has to send a large number of Apple Events. It would be great to get a more powerful scripting interface so one could write things like [code] set theTasks to every task whose name contains "TPS Repoort" [/code] Use Help → Send Feedback to submit feature requests.[/QUOTE] |
All times are GMT -8. The time now is 12:56 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.