View Single Post
Thank you for spotting that. The updated GetContext() function in the code above (1.0.2) now finds nested contexts.

It should now read:
Code:
on GetContext(strName)
	if strName ≠ "" then
		tell application "OmniFocus"
			tell default document
				set lstMatches to flattened contexts where name = strName
				if length of lstMatches > 0 then
					return first item of lstMatches
				else
					return (make new context with properties {name:strName})
				end if
			end tell
		end tell
	else
		return missing value
	end if
end GetContext