Alternatively, for a GeekTool list of Next Actions (displaying even when OmniFocus is not running):
Code:
property pstrDBPath : "~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2"
property pEOR : "<eor>"
property pFldDelim : "<fldelim>"
property plstResults : {}
on run
set strSQL to "select name, " & quoted form of pEOR & ¬
" from projectinfo p join task t on p.nexttask=t.persistentidentifier order by dateDue"
RunSQL(strSQL)
set text item delimiters to return & "• "
set strList to "• " & plstResults as string
set text item delimiters to space
set plstResults to {}
strList
end run
on RunSQL(strSQL)
set strCmd to "sqlite3 -separator '" & pFldDelim & "' " & pstrDBPath & space & quoted form of strSQL
set text item delimiters to pFldDelim & pEOR & return -- strip out the end of line \r as well as the record delimiter
set plstResults to text items 1 thru -2 of ((do shell script strCmd) & return)
end RunSQL