Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'An AppleScript for timers using Quicksilver and Growl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript for timers using Quicksilver and Growl
Authored by: IntlOrange on Sep 15, '09 10:08:48AM

The only problem with this AppleScript is that is causes QuickSilver to hang until the timer is complete. So, if you set your timer for "10 minutes", you will not be able to invoke QuickSilver to do anything else until 10 minutes are up.

Using QuickSilver's built-in "run after delay" function is less elegant, as it requires a few extra steps, but it runs the timer in the background, so QS is still available, and its command parsing of time increments is better as well. (QS accepts "10 minutes" or "10m", while the AppleScript chokes on "10m" and needs spaces between numbers and units, as in "10 m 20 s".)

[ Reply to This | # ]
An AppleScript for timers using Quicksilver and Growl
Authored by: tedw on Sep 15, '09 01:07:06PM
you can stop QuickSilver hanging with a unix trick, I think. replace the last bit of the tell block (starting with delay sleepTime) with the following code:
    tell application "GrowlHelperApp" to register as application "QuGrTimer" all notifications {"Timer"} default notifications {"Timer"} icon of application "Quicksilver"

	set theScriptText to "delay " & sleepTime & "
	tell application \"GrowlHelperApp\"
		notify with name \"Timer\" title \"Time's up!\" description \"Your QuGrTimer has finished!\" application name \"QuGrTimer\"
   	end tell"

	set cmd to "echo " & quoted form of theScriptText & " | osascript -"
	ignoring application responses
		do shell script cmd
	end ignoring
Basically, this puts the timing delay loop into a text string, and runs the text string as an applescript via unix without waiting for it to complete. This should set the timer running in the background as an independent process, and free up quicksilver to get back to it's normal business. I haven't actually tested it (don't have growl OR quicksilver installed), but it should work.

[ Reply to This | # ]