Guest
2010-08-29, 01:21 PM
Quote:
Originally Posted by Bemused
Any advice.. I get the following error "OmniFocus got an error: Can’t get completion date of value of tree 1 of content of document window"
|
In OF 1.8 the do_OmniFocus function can be written a little more simply, without creating a window and reading values from trees.
If you are running OF 1.8 you could try replacing it with something like:
Code:
on do_OmniFocus(strText)
set dteToday to date (short date string of (current date))
tell application id "com.omnigroup.OmniFocus"
tell default document
set refDoneToday to a reference to (flattened tasks where (completion date ≥ dteToday))
set {lstName, lstContext, lstProject} to {name, name of its context, name of its containing project} of refDoneToday
set strText to ""
repeat with iTask from 1 to count of lstName
set {strName, varContext, varProject} to {item iTask of lstName, item iTask of lstContext, item iTask of lstProject}
set strText to strText & "OmniFocus: " & tab & strName
if varContext is not missing value then set strText to strText & " @" & varContext
if varProject is not missing value then set strText to strText & " (" & varProject & ")"
set strText to strText & return
end repeat
end tell
end tell
strText
end do_OmniFocus
--
Last edited by RobTrew; 2010-08-30 at 08:32 AM..