Handling grey stars in Music on Mac

Last modified: Nov 29, 2019 12:50 PM
14 1805 Last modified Nov 29, 2019 12:50 PM

Music 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 Music. In an effort to achieve this I've written the following four scripts. They each work on the current selection of tracks in Music. 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 - 2019-11-29
tell application "Music"
  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 - 2019-11-29
tell application "Music"
  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 - 2019-11-29
tell application "Music"
  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 - 2019-11-29
tell application "Music"
  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/Music/Scripts with the respective filenames and you can access the scripts from the Music menu bar. Create the folders Music and Scripts if required. (~ is your user's home folder /Users/<User>)



macOS pre-Catalina

See Handling grey stars - Apple Community for the iTunes for Mac versions of these scripts.



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.