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

Click here to return to the 'AppleScripts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Authored by: duffster on Feb 02, '05 01:23:19AM
I've tried using iTune's BPM feature, but find it to be a hastle and not worth the time to figure the BPM of all of my songs, especially since the BPM does not necessarily seem to always correlate with the energy of all songs. So why not have the BPM show the rating on a 0-100 scale? That's what I've decided to use it for, and if anyone wants to follow suit, then here are some AppleScripts that do just that: First, we need to convert all existing BPM values to the associated rating. This script will do that, but it takes a while to run, especially for large libraries. The good news is that you only should need to run it once.

tell application "iTunes"
	set lib to library playlist 1
	repeat with i from 1 to (count file tracks of lib)
		log i
		set TrackRating to (a reference to rating of track i of lib) as integer
		set bpm of track i of lib to TrackRating
	end repeat
end tell
Now to modify my previous script, which allows the user to change a rating...

tell application "iTunes"
	set TrackRating to rating of current track as integer
	display dialog "Rating for this song:" default answer TrackRating
	set dialogInfo to result
	set NewRating to text returned of dialogInfo as integer
	set selectedButton to button returned of dialogInfo
	get selectedButton
	set rating of current track to NewRating
	set bpm of current track to NewRating
end tell
Of course, this script can be placed in ~/Library/iTunes/Scripts for easy access. Unfortunately it will only change the value on a track which is playing, but that works for me, as I might need my memory jogged to just remember how over-/under-rated a track was using the five star system. The only "problem" with this system that I have found is that changing the rating using the traditional iTunes method of clicking the stars will change the actual rating back to a multiple of 20, while leaving the BPM rating at the old value. I'd appreciate any modifications to either of these scripts, as well as any feedback from those who might use it. :-)

[ Reply to This | # ]
Authored by: SC_shooter on Feb 02, '05 09:46:39AM

That sounds like a great idea to me. I couldn't care less about the BPM field. I could just use it for the rating.

This might be a good idea for a Tiger widget - an iTunes controller that lets you change the numeric rating of the current song also.


[ Reply to This | # ]