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.

2 comments | no trackbacks

Comments

  1. mathie said about 9 hours later:

    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 50 in else if t > 50 then should be a 5?

    Thanks for the script!

  2. Ben Jackson said about 14 hours later:

    One thing: I suspect the 50 in else if t > 50 then should be a 5?

    Good eyes. Thanks!

Trackbacks

Use the following link to trackback from your own site:
http://www.unfitforprint.com/trackbacks?article_id=set-itunes-rating-with-quicksilver&day=25&month=09&year=2006

Comments are disabled