Estimated time script? What's wrong?

Hey,

Can’t figure out what am I doing wrong.

I want to have a script where a selected task(s) will be assigned 30 minutes of estimated time:

tell application "OmniFocus"
	tell content of first document window of front document
		set SelectedTasks to value of (selected trees where class of its value is not item and class of its value is not folder)
		
		set estimated minutes of SelectedTasks to "30"
		
	end tell
end tell

Try this!

tell application "OmniFocus"
	tell front document
		tell content of document window 1
			set SelectedTasks to value of every selected tree
			if ((count of SelectedTasks) < 1) then
				display alert "You must first select an item to complete." as warning
				return
			end if
			repeat with anItem in SelectedTasks
				set estimated minutes of anItem to 30
			end repeat
		end tell
	end tell
end tell
1 Like