Copy BPM & Star rating to Comments in itunes using Applescript I want an applescript to grab the BPM &amp; Star Rating of a selected group of MP3's and paste the info into the comments section. 

I found this code that will copy the star rating one track at a time but I do not know applescript well enough to modify it to do a group of selected tracks and also grab the BPM. 

tell application "iTunes"
    set theTrack to (item 1 of (get selection))
    set theRating to rating of theTrack
    if theRating = 100 then
        set comment of theTrack to "5 Star"
    else if theRating ≥ 80 then
        set comment of theTrack to "4 Star"
    else if theRating ≥ 60 then
        set comment of theTrack to "3 Star"
    else if theRating ≥ 40 then
        set comment of theTrack to "2 Star"
    else if theRating ≥ 20 then
        set comment of theTrack to "1 Star"
    else if theRating = 0 then
        set comment of theTrack to "0 Star"
    end if
end tell
You want to grab the selection, which will be a list of tracks. Then, you use a repeat block to process each track in the list. Here's the script. You may want to adds checks to make sure iTunes is running, and some try blocks in case of failures:

tell application "iTunes"
    set selectedTracks to selection
    repeat with thisTrack in selectedTracks
        set theRating to rating of thisTrack
        set theBPM to bpm of thisTrack
        set theComment to "" &amp; (theRating / 20 as integer) &amp; " star | BPM: " &amp; theBPM
        set comment of thisTrack to theComment
    end repeat
end tell