Here's a slightly improved version. It creates an invisible window to do the data extraction, so your existing windows aren't affected, and it handles the case of an action without a context.
Code:
property TargetPerspective : "Geek Tool" -- set this to the name of the perspective that shows desired actions set taskList to "" tell application "OmniFocus" tell default document set _window to make new document window with properties {visible:false} at front of document windows tell _window set perspective name to TargetPerspective set oTrees to trees of content set n to count of oTrees repeat with i from 1 to n set oTask to value of (item i of oTrees) set taskTitle to name of oTask try set projContext to name of context of oTask on error set projContext to "(No Context)" end try set taskList to taskList & " • " & taskTitle & " (" & projContext & ") " end repeat end tell close _window end tell end tell return taskList