The ProjNames() functions is something which I sketched before OF 1.9, and it is no longer required.
The new
flattened projects collection is now all you need:
Code:
tell application "OmniFocus"
set oDoc to default document
set my text item delimiters to ASCII character 10
set projNames to (name of (flattened projects of oDoc where hidden of its folder is false and its status is active)) as string
set my text item delimiters to space
set projNames to do shell script "echo " & quoted form of projNames & " | sort -f"
end tell