View Single Post
Fellow OmniFocus users,

I have been trynig to get an AppleScript of mine to work on a selected range of tasks and was able to figure this out yesterday. Therefore, I thought I would share what I did to both share but also to see if anyone else might have a better solution. The script below sets the Start Date of the selected tasks to the current date + 21 days.

Let me know your thoughts - Thanks.

Code:
tell application "OmniFocus"
	tell application "Finder"
		set dateTarget to (current date)
		set day of dateTarget to ((day of dateTarget) + 21)
	end tell
	set taskList to count of the items of the selected tree of the content of document window 1 of document 1
	set taskPtr to 1
	repeat taskList times
		set taskTmp to the value of item taskPtr of the selected tree of the content of document window 1 of document 1
		set start date of taskTmp to dateTarget
		set taskPtr to (taskPtr + 1)
	end repeat
end tell