View Single Post
The section:

set theContextID to id of item 1 of (complete ContextName as context)
set ContextName to first context whose id is theContextID

Not sure I totally understand the first line, what is the "item 1" referring to?

This works mostly. But it doesn't find the context ID for a context name that are a sub-context (i.e. not on a top context)