trainwreck Posted May 17, 2014 Share Posted May 17, 2014 As a backup feature to how finicky iTunes can be, I store the song ratings in the Comments tag for each track. I've figured out how to create a workflow that gives a track a star rating based on a hotkey, but there is no option to also populate the Comments field. For instance, if I give a track a 4 star rating then I want to store "4 Star" in the comments field. Does that require an applescript? If so, can someone guide me through that process. I'm not a techie (at this). Thanks. Link to comment
deanishe Posted May 24, 2014 Share Posted May 24, 2014 (edited) You can get/set ratings, comments and most track metadata with AppleScript. To get you started, this script will get the rating of each selected track, calculate the number of stars (ratings are 0–100) and print the output to AppleScript Editor's Event Log: tell application "iTunes" repeat with the_track in selection set the_rating to the_track's rating if the_rating is greater than 0 then set the_stars to the_rating / 20 else set the_stars to 0 end if log the_track's name & " rating : " & the_rating & " (" & the_stars & " stars)" end repeat end tell Some example output: (*Disco Stomp rating : 20 (1.0 stars)*) (*Ma Baker rating : 0 (0 stars)*) (*I Don't Like Mondays rating : 60 (3.0 stars)*) (*Nobody Does It Better rating : 80 (4.0 stars)*) (*Le Freak rating : 80 (4.0 stars)*) Edited May 24, 2014 by deanishe Link to comment
Carlos-Sz Posted May 24, 2014 Share Posted May 24, 2014 Here is a example on how to set a comment to the selected track: tell application id "com.apple.iTunes" -- iTunes.app set comment of item 1 of selection to "5" end tell Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now