Guest
2010-11-20, 01:04 PM
As a curiosity, here is an Sqlite version. Arguably less easy to maintain (the SQL queries are probably less transparent than applescript, and might need to be adjusted for later versions of OF).
On the other hand, it's rather short and simple, works even when OmniFocus is not running, and is quite fast.
Code:
property pstrDBPath : "~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2"
property pstrFieldDelimiter : tab
set strQuery to "
select \"• \", t.name, \"(No Context)\" from task t where context is null order by t.name;
select \"• \", t.name, c.name from task t join context c on t.context=c.persistentIdentifier
where effectiveActive=1 and dateCompleted is null order by c.name, t.name;
"
set taskList to runquery(strQuery)
on runquery(strQuery)
set strCmd to "sqlite3 -separator '" & pstrFieldDelimiter & "' " & pstrDBPath & space & quoted form of strQuery
do shell script strCmd
end runquery
Last edited by RobTrew; 2010-11-20 at 04:11 PM..