iTunes rating keyboard shortcut (Updated / deprecated method)

I asked myself the question today, is there a way to rate a song in iTunes with a keyboard shortcut? Yes, there is.

I found a walk-through on how to do this at www.macgeekery.com
describing how, but it’s a walk through that’s better suited for those looking to learn how to write more scripts.

If you just want to get it working, here’s how…

  1. Open the System Preferences, open Keyboard & Mouse, click on the Keyboard Shortcuts
  2. Create 5 new short cuts, name them Rate as 1, Rate as 2, … Rate as 5. (Remember how they are named exactly) Make each of the 5 short cuts react to the short cut you want to, e.g. I set Rate as 1 to apple-alt-1, rate as 2 to apple-alt-2 and so on
  3. Create the folders if they don’t exist, but you’ll be saving 5 files in /Library/iTunes/Scripts (or ~/Library/iTunes/Scripts in you only want the short cuts in one users iTunes)
  4. Open the application Script Editor (Applications/AppleScript/Script Editor) and enter the following into the script window…

    tell application "iTunes"
    set the rating of current track to 20
    end tell

    (thanks for the error fix Andy)

  5. Save As “Rate as 1″ exactly as the short cut that was created is named, in the folder you created in the last step. (File format should be script)
  6. Do this four more times, but before you save change the 20 from above to match the following (20 = 1 star)(40 = 2 star)(60 = 3 star)(80 = 4 star)(100 = 5 star)
  7. Almost set, now you just need to restart something called SystemUIServer. Open the Activity Monitor (Applications/Utilities/Activity Monitor), then find the Process Name (SystemUIServer) and Quit Process. Like the Finder, if you Force Quit it will just re-start almost instantly. (Alternatively, you could reboot the computer)

You should be all set now, in iTunes you can rate the selected song with the keyboard short cuts. If you don’t like apple-option-number you can use whatever you want, just tweak the keyboard short cuts menu.

Update 1: Here’s a couple links that may help. One is X-Tunes, an app that might replace what your looking at this script for.

http://www.pol-online.net/x-tunes
http://proxi.griffintechnology.com/blog/2007/09/06/trigger-chains-with-applescript/

After upgrading to Snow Leopard, there is a different process to this. Not much but enough to warrant a different post. It does result in editing the stars for the current track in from in any app. Follow this walk through for Snow Leopard

This entry was posted in Computer Tweaks. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

11 Comments

  1. Chris
    Posted September 30, 2009 at 2:17 pm | Permalink

    Amazing. This tip is great, very well written and really easy to follow. Thanks a lot.

  2. Bartek
    Posted February 20, 2010 at 12:23 pm | Permalink

    Huge thanks for this FIX :) I was looking for some time for exactly this kind of solution :)

  3. Posted March 6, 2010 at 2:12 pm | Permalink

    I just bought my first Mac. I’m hugely impressed by the ability to customize and “fix” behaviors in applications using a little Apple Script.

    Thank you for this tutorial!

  4. Ollie
    Posted June 3, 2010 at 12:23 pm | Permalink

    Hey there,

    Great script but is it possible to make this script change the rating for the currently playing song, rather than the selection?

  5. Posted July 22, 2010 at 6:45 pm | Permalink

    To rate current song:

    tell application “iTunes”
    set the rating of current track to 60
    end tell

    60 would be the rating.

  6. Posted July 22, 2010 at 9:00 pm | Permalink

    Thanks Andy, I updated the post to reflect that. Much more smooth now, and that answers Ollie’s question.

    If you have 10.6 Snow Leopard check out the new post I put together. It accounts for the slightly different process it takes to add the shortcuts, and the shortcuts are functional no matter what app is in the forground.

  7. gojira
    Posted November 13, 2010 at 7:39 am | Permalink

    wow,
    that’s the script I’m looking for :-) ))

    many thanks
    gojira

  8. Joseph
    Posted December 18, 2010 at 6:08 am | Permalink

    Worked instantly.
    No bugs. Just wirks.
    Thank you for taking your time to explain.

  9. Posted May 6, 2011 at 1:18 pm | Permalink

    I’m a little late to the party, but this is exactly what I’ve been looking for! I was using an app called GimmeSomeTunes and it had this feature, but all of a sudden the app would just fail constantly so I was forced to find an alternate app. The new one doesn’t have a key-shortcut for ratings. This works beautifully. :] I only wish I could make it rate iTunes even when I’m in another app, as a more “universal” key stroke or something. A girl can dream, can’t she? :] Thanks for the tutorial.

  10. Posted May 6, 2011 at 1:35 pm | Permalink

    @lenalandmine Make sure to check out this updated version which includes using Automator to run the script.

    With that version I can do it from any app. (As long as you don’t get keyboard shortcuts conflicting… I use cmd-alt-shift-#)

  11. HanaPipers
    Posted February 7, 2012 at 6:10 pm | Permalink

    :)

One Trackback

  1. By A Digital Notepad on July 22, 2010 at 8:50 pm

    [...] while back I wrote this post describing my efforts in looking for a way to rate iTunes shortcuts anytime with a quick shortcut [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">