Thread: due date format
View Single Post
You're asking Applescript to know how OmniFocus interprets date strings, which isn't a reasonable request. It isn't difficult to code it up yourself, but why do a bunch of work to emulate what the program will do for you? An easier route would be to use the parse tasks construct.

Code:
tell application "OmniFocus"
	tell default document
		set Val1 to "foo"
		set Date1 to "# 1d"
		set Date2 to "# 3d"
		set Date3 to "# 7d"
		set Task1 to parse tasks with transport text Val1 & Date1
		set Task2 to parse tasks with transport text Val1 & Date2
		set Task3 to parse tasks with transport text Val1 & Date3
	end tell
end tell
See the built-in help for "Processing mail messages into actions" for details on the format to use.