Hope this makes sense:
Code:
tell application "OmniFocus"
set strContextName to "Waiting"
tell front document
set lstMatches to complete strContextName as context
if length of lstMatches > 0 then
set recMatch to item 1 of lstMatches
set strID to id of recMatch
set oContext to context id strID
set lstAllTasks to tasks of oContext
set lstAvailable to available tasks of oContext
set lstRemaining to remaining tasks of oContext
else
display dialog "Context: " & strContextName & " not found."
end if
end tell
end tell