View Single Post
If you'd like to get at the raw data without needing OmniFocus to be running, you could write something along these lines (to get sorted rows of three tab-delimited fields).

( man sort in Terminal.app will list the other switches for the bash sort command )

Code:
property pstrSQL : quoted form of "
SELECT p.name, c.name, tt.name 
FROM ((task t left join projectinfo pi on t.containingprojectinfo=pi.pk) tt 
left join task p on tt.task=p.persistentIdentifier) 
left join context c on tt.context = c.persistentIdentifier
WHERE tt.flagged=1 and tt.dateCompleted is null"

tell application id "MACS" to set strID to (get id of application file id "OFOC")
set strDBPath to "~/Library/Caches/" & strID & "/OmniFocusDatabase2"
set strLines to do shell script "sqlite3 " & strDBPath & space & pstrSQL & " | tr '|' '\\t' | sort -k 1,2"
--

Last edited by RobTrew; 2012-07-24 at 07:54 AM.. Reason: Edited SQL to include tasks in Inbox