Guest
2011-03-02, 02:23 PM
Code:
property pTitle : "Set due date of task matching string"
set str to text returned of (display dialog "Enter string:" default answer "" with title pTitle)
tell application id "com.omnigroup.OmniFocus"
tell default document
set refTasks to a reference to (flattened tasks where name contains str)
if (count of refTasks) < 1 then return
set oTask to first item of refTasks
set dteToday to (current date)
set dteToday to dteToday - (time of dteToday)
set due date of oTask to dteToday + 3 * days
end tell
set dteDue to due date of oTask
end tell
display dialog (date string of dteDue & tab & time string of dteDue) buttons {"OK"} with title pTitle
Last edited by RobTrew; 2011-03-02 at 02:28 PM..