(2016 Update: New Link)

One of the most handy tools for Mac has to be Quicksilver. It does 90% of my application launching, and has a plethora of plugins and other features too, like triggers. Triggers work like global hotkeys. For example, I can press control-F8 in (almost) any application and have iTunes skip to the next song.

What I like to do is be able to rate my iTunes music without having to switch to iTunes or fumble around with the dock contextual menu. With a Quicksilver trigger this is easy, just install the iTunes module and a handful of iTunes-specific triggers are added. However, I prefer to have visual notification that the trigger worked, so I made a few Applescripts to automatically set the rating and tell Growl to display a notification that the change was made.

Script below:

-- check for apps needed
tell application "System Events"
	set iTunesRunning to ¬
		(count of (every process whose name is "iTunes")) > 0
	set growlRunning to ¬
		(count of (every process whose name is "GrowlHelperApp")) > 0
end tell

if iTunesRunning is true and growlRunning is true then
	tell application "iTunes"
		set thistrack to current track
		set therating to 20
		set rating of thistrack to (therating)
		set songdesc to (name of thistrack) & return & (artist of thistrack) & return & (album of thistrack)
		set trackArt to (data of artwork 1 of thistrack)
	end tell
	tell application "GrowlHelperApp"
		set the allNotificationsList to {"Star Rating"}
		set the enabledNotificationsList to {"Star Rating"}
		register as application "Rating Scripts" all notifications allNotificationsList default notifications enabledNotificationsList
		notify with name "Star Rating" title "★☆☆☆☆" description songdesc application name "Rating Scripts" pictImage trackArt
	end tell
end if

I saved five version of the script, for ratings 1 to 5, changing the values for each one. “set therating to 20” is one star, 40 is two stars, etc. I also changed the ★s for each script. Then in Quicksilver, I added new triggers that activated these scripts, and now control-F1 through F5 rate the current song, and display a Growl notification with track art and information.