I've been trying to select a "found" context without luck. In this example, I'm selecting tree 2, but I would like to select the found "Grocery" context. Can anybody give me a pointer?
Thanks,
Eric
Thanks,
Eric
Code:
tell application "OmniFocus" set oContextList to contexts of first document set oContext to my FindContext("Grocery", oContextList) set cname to name of container of oContext tell front document to tell first document window to tell sidebar to tell library to select tree 2 -- of oContext set ttt to name of tree 2 of library of sidebar of first document window of front document end tell -- get a pointer to any defined context with this name on FindContext(strName, oContexts) tell application "OmniFocus" ignoring case repeat with oContext in oContexts -- set strContextName to name of oContext if (name of oContext) = strName then return oContext else set oSubContexts to contexts of oContext if (count of (oSubContexts)) > 0 then set ContextFound to my FindContext(strName, oSubContexts) -- Check whether a context has in fact been found try set SomeName to name of ContextFound return ContextFound end try end if end if end repeat end ignoring end tell end FindContext