One annoying thing about the rating system in iTunes is the inability to totally remove ratings from a song. Use the following AppleScript to pop up a dialog box that will allow you to set the rating of the current song to any value between 0 and 100. Set the rating to 0 (or use the button) to remove the rating.
Grab the compiled script here. Just save the script in your ~/Library -> iTunes -> Scripts folder and it will appear in the script menu of iTunes. For those that are interested, here's the source to the script.
[Editor's note: I've pasted the source into the body of this article as well, in case the referenced site isn't available.]
Paste into Script Editor:
tell application "iTunes"
set art to artist of the current track as string
set trackname to name of the current track as string
set thisalbum to album of the current track as string
set thisrating to rating of the current track as string
set vol to volume adjustment of the current track as string
set newrating to thisrating
set button_pressed to ""
display dialog "Artist: " & art & "
Track: " & trackname & "
Album: " & thisalbum & "
Volume Adjustment: " & vol default answer newrating ¬
buttons {"OK", "Cancel", "Reset Rating"}
copy the result as list to {the newrating, the button_pressed}
try
set newrating to newrating as integer
on error
display dialog "Not a valid rating"
set newrating to thisrating
end try
if the button_pressed is "Reset Rating" then
set the rating of the current track to 0
end if
if the button_pressed is "OK" then
if newrating is not "" then
set the rating of the current track to newrating
else
display dialog "rating unchanged"
end if
end if
end tell
Mac OS X Hints
http://hints.macworld.com/article.php?story=20021203064751331