Get list of all tasks completed today

I’m attempting to write an Applescript to return a list of all tasks that had been completed today. However, I’m just continually getting an empty list back. Can anyone explain what I might be doing wrong? Thanks!

on getAllTasksCompletedToday()
	tell application "OmniFocus"
		tell front document
			set completedTasks to (every flattened task where its completed = true and completion date = (current date))
		end tell
	end tell
	return completedTasks
end getAllTasksCompletedToday

getAllTasksCompletedToday()

Maybe try something like:

    on getAllTasksCompletedToday()
	set dateToday to date (short date string of (current date))
	tell application "OmniFocus"
		tell front document
			set completedTasks to (every flattened task whose completed is true and completion date ≥ dateToday)
		end tell
	end tell
	return completedTasks
end getAllTasksCompletedToday

getAllTasksCompletedToday()
1 Like