View Single Post
PS There are some other routes to the same result, but they are slow and clumsy, and being able to use missing value correctly would be very much faster and simpler.

This, for example, proves slow ...

Code:
-- set dte to missing value as date
tell application "OmniFocus"
	set today to my TimelessToday()
	tell front document
		count of flattened task
		set refTasksNoStart to a reference to (flattened tasks where not (start date < today) and not (start date ≥ today))
		set refTasksNoDue to a reference to (flattened tasks where not (due date < today) and not (due date ≥ today))
		
		display dialog (((count of refTasksNoStart) as string) & " without start date" & return & return & ¬
			(count of refTasksNoDue) as string) & " without due date" with title ("Total of " & (count of flattened tasks) as string) & " tasks"
	end tell
end tell

on TimelessToday()
	set dte to current date
	date "00:00" of dte
end TimelessToday

Last edited by RobTrew; 2010-07-09 at 03:41 AM.. Reason: adjusted sample code