How do I select the top task in the current OmniFocus Window

I am trying to do this being new to Applescrpiting OmniFocus. I have tried this:

tell application id “com.omnigroup.OmniFocus2”
tell default document
tell the front document window
set theTasks to tree of content
set theTask to item 1 of theTasks
set theTask’s selected to true
end tell
end tell
end tell

Which does nothing. I simply want the top task on the page to be selected. What am I doing wrong?