This script could certainly be restored to health. For example, the loading delay - which has been commented on - could now be eliminated (in OF 1.8) by replacing all of the loading code, from "--chargement des contexts" to "--fin du chargement" with the much simpler and faster:
Code:
tell application id "com.omnigroup.OmniFocus"
tell default document
set {refContexts, refProjects} to {a reference to flattened contexts, a reference to flattened projects}
end tell
set {contextidlist, contextnameList} to {id, name} of refContexts
set {projectidList, projectnameList} to {id, name} of refProjects
end tell
It could also be adjusted to create any assumed folders and contexts where necessary, etc etc