Set iTunes Rating with Quicksilver
Posted by Ben Jackson Mon, 25 Sep 2006 18:31:00 GMT
File this one under "I must be a mongloid for not having thought to do this before".
Open up Script Editor, and save the following as "Set Rating for Current Track".
using terms from application "Quicksilver"
on process text t
if t contains "*" then
set myrating to 20 * (length of t)
else if t > 5 then
set myrating to 100
else if t < 0 then
set myrating to 0
else
set myrating to 20 * t
end if
tell application "iTunes" to set rating of current track to myrating
end process text
end using terms from
Stick it in ~/Library/Application Support/Quicksilver/Actions and you'll have an Action to set the rating for the current song in iTunes. Open Quicksilver, type your rating (e.g. ***** or 5), type Rating, hit ENTER, and watch your five-star playlist grow.
Extra points for assigning triggers to the numeric keypad's 1-5 keys.

Neat! I've been meaning to do something along these lines for a while now. The thought process in my head was to set the entire contents of my iTunes library's ratings to 3 (can't get 2.5, can I?), then have two Quicksilver actions: one to increase the rating, the other to decrease it. That way things would bubble up and down. But since I don't have AppleScript-fu, I've never done it...
One thing: I suspect the
50inelse if t > 50 thenshould be a5?Thanks for the script!
Good eyes. Thanks!