A sample code fragment:
Code:
property pMaxAge : 2 -- max number of seconds since creation for tasks of interest
tell application "OmniFocus"
set timeNow to current date
set timeThen to timeNow - pMaxAge
tell front document
set newTasks to (every flattened task whose (creation date is greater than timeThen ¬
and repetition is missing value))
end tell
display alert "Found " & (count of newTasks) & " tasks"
end tell