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…
- Open the System Preferences, open Keyboard & Mouse, click on the Keyboard Shortcuts
- 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
- 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)
- Open the application Script Editor (Applications/AppleScript/Script Editor) and enter the following into the script window…
(thanks for the error fix Andy)tell application "iTunes"
set the rating of current track to 20
end tell - 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)
- 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)
- 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.
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
11 Comments
Amazing. This tip is great, very well written and really easy to follow. Thanks a lot.
Huge thanks for this FIX
I was looking for some time for exactly this kind of solution
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!
Hey there,
Great script but is it possible to make this script change the rating for the currently playing song, rather than the selection?
To rate current song:
tell application “iTunes”
set the rating of current track to 60
end tell
60 would be the rating.
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.
wow,
))
that’s the script I’m looking for
many thanks
gojira
Worked instantly.
No bugs. Just wirks.
Thank you for taking your time to explain.
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.
@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-#)
One Trackback
[...] while back I wrote this post describing my efforts in looking for a way to rate iTunes shortcuts anytime with a quick shortcut [...]