The script below attempts to automatically query the allmusic.com website to find Tones (see robg's note below) associated with an iTunes track. The Tones are then added to the comments field of the track. I've seen people express a desire for such a script, so thought I'd post what I've come up with -- but check the caveats below...
The script is written in Perl and requires WWW::Mechanize and Mac::AppleScript::Glue to be installed. The script goes through all the currently selected iTunes tracks (tracks highlighted in blue). For each track, it first queries allmusic.com to find the artist. If there are Tones associated with the artist, it remembers these. It then tries to find the album. If it finds the album, then it uses the Tones associated with the album, rather than those associated with the artist. All tracks in a given album will have the same Tones. The Tones are applied to the comment field of the track by adding them onto whatever comments are already present.
Read the rest of the hint for some caveats and the script...
Caveats:
v-string in use/require non-portable at /Library/Perl/Mac/AppleScript/Glue.pm line 234.at the start is due to a change in the way Perl deals with version numbers. It'll also say:
Unknown input type 'textfield' at /Library/Perl/WWW/Mechanize.pm line 1335 a lot.Neither are fatal (or even harmful) and can be ignored or patched (just add textfield to the appropriate part of WWW::Mechanize). This is left as an exercise for the reader.
[robg adds: Tones are like genres on steroids. For instance, the Tones for Paul Simon's Graceland are 'Whimsical, Summery, Exuberant, Organic, Cheerful, Laid-Back/Mellow, Happy, Poignant, Rousing, Playful, Fun, Reflective.' Having Tones attached to your songs will allow you to create some very targeted playlists. I've also mirrored the script on the macosxhints' server, in case the original goes away at some point. I have not tried this yet, but intend to once I have some time to update my Perl installation.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040514091905395