import win32com.client def main(): from_quote = u'\xb4' to_quote = "'" iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application") library = iTunes.LibraryPlaylist tracks = library.Tracks track_count = tracks.Count for track_index in range(1, track_count+1): track = tracks.Item(track_index) if from_quote in track.Name: newval = track.Name.replace(from_quote, to_quote) print 'replacing', repr(track.Name), 'with', repr(newval) track.Name = newval if from_quote in track.Artist: newval = track.Artist.replace(from_quote, to_quote) print 'replacing', repr(track.Artist), 'with', repr(newval) track.Artist = newval if from_quote in track.Album: newval = track.Album.replace(from_quote, to_quote) print 'replacing', repr(track.Album), 'with', repr(newval) track.Album = newval if __name__ == '__main__': main()