View Single Post
Are you parsing a single task? You can embed your start and due dates directly in the string you hand off to parse tasks:

Code:
tell application "OmniFocus"
set theText to "Call Mom #tomorrow 9am #+2d 9pm"
set singleTask to true
tell default document
parse tasks with transport text theText as single task singleTask
end tell
end
See the built-in help for Processing Mail messages for all of the details, including setting context and project.

The problem with your script as you've written it is that you aren't grabbing the value returned from parse tasks and then using it to set the dates. Something like this would work, if you didn't want to use the approach shown above:

Code:
tell application "OmniFocus"
	set theText to "Call Mom"
	set singleTask to true
	tell default document
		set myNewTasks to parse tasks with transport text theText as single task singleTask
	end tell
	set start date of first item of myNewTasks to (current date)
	set due date of first item of myNewTasks to (current date) + 4 * days
end tell