Handling grey stars

Last modified: Feb 12, 2024 2:35 PM
14 7117 Last modified Feb 12, 2024 2:35 PM

iTunes normally assigns automatic track ratings for unrated tracks on the basis of any manual album rating, and an automatic album rating as a mean average of any manually rated tracks if there is no manual album rating. This may have undesirable effects on ratings based smart playlists, leaving some users looking for a way to suppress auto-ratings in iTunes. In an effort to achieve this I've written the following four scripts. They each work on the current selection of tracks in iTunes. The first two work by replacing computed ratings with a manual rating of 1%, which displays as no stars and should work properly with smart playlists. The second pair restore the default auto-rating behaviour if and when that might be wanted.



-- ClearAlbumAutoRating - V1.0 - © Steve MacGuire - 2015-11-14
tell application "iTunes"
  if selection is not {} then
    set mySelection to selection
    repeat with aTrack in mySelection
      if album rating kind of aTrack is computed then set album rating of aTrack to 1
    end repeat
  end if
end tell



-- ClearTrackAutoRating - V1.0 - © Steve MacGuire - 2015-11-14
tell application "iTunes"
  if selection is not {} then
    set mySelection to selection
    repeat with aTrack in mySelection
      if rating kind of aTrack is computed then set rating of aTrack to 1
    end repeat
  end if
end tell



-- SetAlbumAutoRating - V1.0 - © Steve MacGuire - 2015-11-14
tell application "iTunes"
  if selection is not {} then
    set mySelection to selection
    repeat with aTrack in mySelection
      if album rating of aTrack is 1 then set album rating of aTrack to 0
    end repeat
  end if
end tell



-- SetTrackAutoRating - V1.0 - © Steve MacGuire - 2015-11-14
tell application "iTunes"
  if selection is not {} then
    set mySelection to selection
    repeat with aTrack in mySelection
      if rating of aTrack is 1 then set rating of aTrack to 0
    end repeat
  end if
end tell



Copy and paste the selected script into the Script Editor application on your Mac. Save in ~/Library/iTunes/Scripts with the respective filenames and you can access the scripts from the iTunes menu bar. Create the folders iTunes and Scripts if required. (~ is your user's home folder /Users/<User>)



Catalina or later

If you've upgraded to macOS 10.15 Catalina or later you can replace "iTunes" with "Music" in each of the scripts above to make scripts that will work with the new Music app. The scripts can be placed in ~/Library/Music/Scripts. See Handling grey stars in Music on Mac - Apple Community for an updated version of this user tip with the edits in place.



Windows

There are parallel scripts for Windows users at http://samsoft.org.uk/iTunes/scripts.asp:


Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.