Thread: Recursion
View Single Post
And if you particularly want to pick out childless tasks at the top level (of the inbox or a project), you could test for them with a function like:

Code:
on IsTopLevelSingleTask(oItem)
	using terms from application "OmniFocus"
		tell oItem
			if number of tasks > 0 then return false
			set {oParent, oProject} to {parent task, containing project}
		end tell
		
		if oProject is missing value then -- inbox task
			(oParent is missing value) -- true if no parent task
		else -- project task
			(oParent is root task of oProject) -- true if parent is project
		end if
	end using terms from
end IsTopLevelSingleTask
--

Last edited by RobTrew; 2011-08-02 at 06:27 AM..