This will show you all tasks that are due within the next 3 days, provided you use @due(YYYY-MM-DD). It will also cut out tasks which have a start date in the past, provided you use @start(YYYY-MM-DD). Updated 2010-04-29 to put dates in quotes so it will work with TP 2.2.2
on getShortDate(now)
set {day:d, year:y, time:t} to now
-- Calculate the month number.
copy now to b
set b's month to January
set m to (b - 2500000 - now) div -2500000
-- Short date in yyyy-mm-dd format.
tell (y * 10000 + m * 100 + d) as string
set dateString to text 1 thru 4 & "-" & text 5 thru 6 & "-" & text 7 thru 8
end tell
return dateString
end getShortDate
set today to getShortDate(current date)
set soon to getShortDate((current date) + 3 * days)
set searchString to "(@due < \"" & soon & "\" and (not @start or @start <= \"" & today & "\"))"
tell application "TaskPaper"
set the search field string of the front document to searchString
end tell