This will work:
Code:
tell application id "OFOC"
tell default document
set oProj to project named "top level project"
end tell
end tell
but only if that project is an immediate child of the document. i.e. if it is a top level project, not contained in a folder.
To find a project in a folder you would have to "tell" that folder to
Code:
set oProj to project named "contained in folder"
In other words unflattened objects are only found by name within the scope of their containing object (e.g. containing folder for projects, parent context for contexts, containing group or project for tasks).