Applescript: Searching for tasks that fit specific requirements
Hi guys,
I was wondering a few things about the Applescript implementation. (you may be able to see where I'm going with this eventually)... I've learned some simple stuff with a few moments of playing... I can get selected task information, I can set selected task information. I can also get top window search-term text and set top window search term text. But, here's a big Q... is it possible to get OmniFocus to return all tasks which fit specific search requirements? For instance, can I set all aspects of filters and search-terms via applescript and return (to the user in the omnifocus window forefront) the tasks which are visible in the top window that meet said search and filter requirements? Thanks for your thoughts on this. If you need more clarification of what I'm meaning here, please let me know. Cheers! -Allen |
Take a look at the settable properties of the Content Tree in the OF applescript dictionary, from [B]selected grouping identifier[/B] onwards.
|
Thanks Rob! I was able to get somewhere. I'll keep working on it. :) Thanks!
|
Hmm.. I'm having trouble figuring out how to script these... can't seem to get these items to view them... can anyone shed light on setting these tree items etc.,?
|
Here's a snippet of code lifted from [URL="http://www.rose-hulman.edu/~clifton/software.html"]my Where To Focus widget[/URL]. This is edited for clarity, but not tested:
[CODE] tell application "OmniFocus" tell front document set theWindow to first document window tell sidebar of theWindow if showOnlyActiveContexts then set selected smart group identifier to "active-contexts" else set selected smart group identifier to "available-contexts" end if end tell tell content of theWindow set selected grouping identifier to groupingIdentifier set selected sorting identifier to sortingIdentifier set selected task state filter identifier to taskStateFilterIdentifier set selected task duration filter identifier to taskDurationFilterIdentifier set selected task flagged filter identifier to taskFlaggedFilterIdentifier end tell end tell end tell [/CODE] The variables at the end of the last 5 set lines (groupingIdentifier, etc.) are used to set the view bar lozenges. A corresponding command, [B]get available grouping identifiers[/B] will give you a list of the allowed values for the variable. |
Hey Curt,
Excellent, thank you for the code examples. Nothing helps like code examples! :) I'll keep playing. Essentially I want to set the various selected task filter settings on the main window through a script... and I think you are doing so right here, so I think this is to the point. :) I greatly appreciate your help!! -Allen ps- where to focus is quite awesome- this is *exactly* the type of thing that leverages the power of our computers. |
All times are GMT -8. The time now is 05:01 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.