tell application "iTunes" copy (a reference to (get view of front window)) to thePlaylist if selection exists then set using_selection to true copy (count selection's items) to idx else -- its the whole playlist set selectedTracks to (get a reference to thePlaylist) copy (count thePlaylist's tracks) to idx end if set appendum to "iPod Mini" set updatecomment to "Yes" repeat with i from 1 to idx -- select track to modify if using_selection then copy item i of selection to thisTrack else copy track i of selectedTracks to thisTrack end if -- check to see if comment already includes text being appended if thisTrack's comment contains the appendum then set updatecomment to "No" end if -- modify thisTrack's comment if updatecomment is "Yes" then set thisTrack's comment to ((get thisTrack's comment) & " " & appendum) end if end repeat display dialog "Done!" buttons {"Thanks"} default button 1 with icon 1 giving up after 20 end tell