View Single Post
Quote:
Originally Posted by dbyler View Post
getContext returns the best match for a given string, so "home" would match "Home" before the "Home > Garden" context.
And if there is no match, you can always extend getContext to create one:

Code:
on getContext(contextName)
	tell application "OmniFocus"
		tell front document
			try
				first flattened context whose name contains contextName
			on error
				(make new context with properties {name:contextName})
			end try
		end tell
	end tell
end getContext