A simplified script with minimal messages might look like:
Code:
tell application "OmniFocus"
tell front document
tell document window 1
set oTrees to selected trees of content
if length of oTrees > 0 then
set oTask to value of first item of oTrees
set lngMinutes to estimated minutes of oTask
if lngMinutes > 720 then
display dialog "Maximum Minuteur period is 12 hours"
else
try
if lngMinutes is missing value then
else
set strHMS to my MinuteurString(lngMinutes)
tell application "Minuteur"
activate
StartCountdown strHMS
end tell
end if
end try
end if
end if
end tell
end tell
end tell
on MinuteurString(lngMinutes)
set strHoursLeft to (lngMinutes div 60) as string
if length of strHoursLeft < 2 then
set strHoursLeft to "0" & strHoursLeft
end if
set strAdditionalMins to (lngMinutes mod 60) as string
if length of strAdditionalMins < 2 then
set strAdditionalMins to "0" & strAdditionalMins
end if
return strHoursLeft & strAdditionalMins & "00"
end MinuteurString