View Single Post
Quote:
Originally Posted by RobTrew View Post
WHERE ... and dateCompleted is null ORDER BY flagged DESC, dateToStart
or perhaps
ORDER BY flagged DESC, dateToStart, dateCompleted
--
Wonderful that did the trick! I am not sure what "flagged DESC" does in this case as well as including "dateCompleted". Removing both of those gives me the same results.

Anyway thank you that is exactly what I was looking for. The cool thing with this it shows actions with start dates now but are part of Projects that have start date in the future. I had a few of those and I didn't realize because OmniFocus doesn't show those actions with Project start dates in the future, which is good that OF behaves this way.
Code:
osascript ~/Library/Scripts/Applications/OmniFocus/GeekOFSQL.scpt 'task where flagged=1 and dateCompleted is null ORDER BY flagged DESC,dateToStart,dateCompleted --header=Flagged ($N)\n' | fold -s -w 40