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 remove_text to " iPod Mini" set replacement_string to "" set updatecomment to "No" 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 includes text being removed if thisTrack's comment contains the remove_text then set updatecomment to "Yes" end if -- modify thisTrack's comment if updatecomment is "Yes" then set this_comment to (get thisTrack's comment) set thisTrack's comment to my replace_chars(this_comment, remove_text, replacement_string) end if end repeat display dialog "Done!" buttons {"Thanks"} default button 1 with icon 1 giving up after 20 end tell on replace_chars(this_text, search_string, replacement_string) if this_text contains the search_string then set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" end if return this_text end replace_chars