View Single Post
RobTrew thank you so much!
I haven't get notified by email so please excuse my late reply.

Your first script works perfectly for me and does what I wanted.
I think the second one is great too because it unclutteres the list by having a header in Pomodoro. But then I don't have the Project name pasted to iCal later on (which I want for getting an overview on what projects I worked on).

So I'm super happy about the first one. Though, I adjusted it to my needs a bit:

This script is a modified version of RobTrew and it returns now also "next actions" of every active project, tasks which have a flagged parent task and it ignores tasks in the "Someday/Maybe" folder. I also added a ▶ symbol to have a clear visual separator between project and tasks.

Code:
property MaxProjChars : 20

tell application "System Events" to if exists process "OmniFocus" then
	tell application "OmniFocus"
		tell default document
			set due_soon to a reference to setting id "DueSoonInterval"
			set due_soon_interval to ((value of due_soon) / days) as integer
			set due_date to (current date) + due_soon_interval * days
			tell (flattened tasks whose completed is false and blocked is false and ((due date is less than or equal to due_date) or (next is true and name of folder of containing project is not "Someday/Maybe") or (flagged is true or flagged of containing project is true or flagged of parent task is true)) and status of containing project is active)
				set {lstProj, lstTasks} to {name of containing project, name}
			end tell
			repeat with i from 1 to length of lstTasks
				set item i of lstTasks to my Truncate(item i of lstProj) & " ▶" & item i of lstTasks
			end repeat
			return lstTasks
		end tell
	end tell
end if

on Truncate(strLong)
	if length of strLong > MaxProjChars then
		return text 1 thru MaxProjChars of strLong
	else
		return strLong
	end if
end Truncate
thanks a lot again!

Marek