The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Applescript: Searching for tasks that fit specific requirements Thread Tools Search this Thread Display Modes
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 selected grouping identifier 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 my Where To Focus widget. 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
The variables at the end of the last 5 set lines (groupingIdentifier, etc.) are used to set the view bar lozenges. A corresponding command, get available grouping identifiers will give you a list of the allowed values for the variable.
__________________
Cheers,

Curt
 
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.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export from the command line or AppleScript for specific contexts/projects? xuinkrbin. OmniFocus Extras 1 2010-09-30 03:21 PM
Tasks Repeats but only for a specific time period SandStorm OmniFocus 1 for Mac 4 2010-01-10 11:04 AM
Searching for Projects/Tasks on iPhone gcrump OmniFocus for iPhone 1 2008-12-19 09:33 AM
Setting daily hours on specific tasks? maltinghead OmniPlan General 4 2008-10-12 12:41 AM
Searching in AppleScript jcater OmniFocus Extras 2 2008-08-29 09:03 PM


All times are GMT -8. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.