View Single Post
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