Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Rate iTunes songs on a wider scale' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Rate iTunes songs on a wider scale
Authored by: robartsd on Mar 23, '05 01:45:31AM

Here's my first script to set the rating. This one is for a selection (supporting multiple tracks). The default rating is the average of the current ratings.


tell application "iTunes"
	set dialogText to ""
	set adverageRating to 0
	set myTracks to get {name, rating} of selection
	repeat with myTrack from 1 to length of first item of myTracks
		set dialogText to dialogText & "Track: " & item myTrack of first item of myTracks & "
			Rating: " & item myTrack of second item of myTracks & "
"
		set adverageRating to adverageRating + (item myTrack of second item of myTracks)
	end repeat
	set adverageRating to {adverageRating / (length of second item of myTracks)} as integer
	set reply to display dialog dialogText default answer adverageRating
	if button returned of reply is "OK" then
		set rating of selection to text returned of reply as integer
	end if
end tell


[ Reply to This | # ]