Guest
2011-07-07, 01:35 AM
Quote:
Originally Posted by dbyler
I just posted a script that calculates and displays the total time estimates of your selected items
|
Good !
FWIW you may be able to simplify (and slightly accelerate) your central counting process by gathering all the selected tree values in a single Apple Event.
Code:
set {Hrs, Mins, itemCount} to SelectedMins()
display alert (Hrs as string) & "h " & (Mins as string) & "m total for " & (itemCount as string) & " items"
on SelectedMins()
tell application "OmniFocus"
tell content of front document window of front document
set lngMins to 0
set lstValues to value of (selected trees where class of its value is not item and class of its value is not folder)
repeat with oValue in lstValues
set varMins to estimated minutes of oValue
if varMins is not missing value then set lngMins to lngMins + varMins
end repeat
return {lngMins div 60, lngMins mod 60, count of lstValues}
end tell
end tell
end SelectedMins
Last edited by RobTrew; 2011-07-07 at 02:31 AM..