View Single Post
I am using this lightly edited version from the toolbar without any problem. Worth a try ?

Code:
-- Light Edit by RT Nov 1 2010
(*
	OmniFocus Timer Script
	
	Version 0.1, by Scott Reeves
	
	The script displays a sticky Growl notification with the selected action from OmniFocus,
	and starts a timer in TimeBoxed, by default 2 minutes. If you've entered a time estimate,
	that value will be used for the timer length.

	Useful as a 2 minute timer, as well as a timer for tasks where you've entered a time estimate.
	
	Scroll down a bit to change the default timer setting to something other than 2 minutes.
	
	Credits:
	Curt Clifton's "What Are You Doing?" script: http://forums.omnigroup.com/showpost.php?p=61416&postcount=18
	Guillaume Cerquant's "TimeBoxed / OmniFocus" script: http://forums.omnigroup.com/showthread.php?t=11859

	Icon from http://kylesteed.com/2009/new-clock-icon/
	
	Version 0.1: Original release
*)

-- Original credits from Curt's script retained
(*
	What Are You Doing?
	
	This script uses Growl to display a sticky note about what you are supposed to be focusing on.
	
	version 0.1, by Curt Clifton
	
	Copyright © 2007-2008, Curtis Clifton
	
	All rights reserved.
	
	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
	
		• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
		
		• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
		
	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	
	version 0.1: Original release
*)

-- Default timer setting if no time estimate is provided (default 2 minutes)
property defaultTimeInMinutes : 2

(*
	The following properties are used for script notification via Growl.
*)
property growlAppName : "OmniFocus Stickies"
property notification : "Stick it"
property defaultNotifications : {notification}
property allNotifications : defaultNotifications
property iconLoaningApplication : "OmniFocus.app"

tell application "OmniFocus"
	tell front document
		tell document window 1
			set taskNote to ""
			
			try
				set lstValue to (value of selected trees of content)
				set oTask to first item of lstValue
			on error
				display alert "Please select an item to work on first." as warning
				return
			end try
			
			-- start out with the default value
			set taskMinutes to defaultTimeInMinutes
			
			tell oTask
				-- update to estimated time if it's set
				if estimated minutes > 0 then
					set taskMinutes to estimated minutes
				end if
				
				set taskTitle to name
				set taskNote to note
			end tell
			
			if taskMinutes > 0 then
				my notify("What are you doing?", taskTitle, notification)
				my startTimer(taskMinutes * 60)
			end if
			
		end tell
	end tell
end tell

(*
	Uses Growl to display a notification message.
	theTitle – a string giving the notification title
	theDescription – a string describing the notification event
	theNotificationKind – a string giving the notification kind (must be an element of allNotifications)
*)
on notify(theTitle, theDescription, theNotificationKind)
	tell application "GrowlHelperApp"
		register as application growlAppName all notifications allNotifications default notifications defaultNotifications icon of application iconLoaningApplication
		notify with name theNotificationKind title theTitle application name growlAppName description theDescription with sticky
	end tell
end notify

on startTimer(numberOfSeconds)
	tell application id "com.macmation.timeboxed"
		activate
		set timer duration to numberOfSeconds
		reset
	end tell
end startTimer