0

iTunes で現在再生中のアーティストの名前を返すこの AppleScript があります。残念ながら、アーティスト名に ú などの特殊文字が含まれていると、奇妙な文字が出力されます。どうすればこれを修正できますか?

tell application "iTunes"
    if player state is playing then
        try
            set myTrack to artist of current track
        on error
            return ""
        end try
        return myTrack
    end if
end tell
4

1 に答える 1

0

通常、Unicode 文字は問題を引き起こしません。

tell application "iTunes" to tell current track
    set name to "あ"
    name -- あ
end tell

一部のファイルの ID3 タグには、非 Unicode エンコーディングが含まれている可能性があります。AppleScript からそれを処理する方法がわかりませんが、タグを UTF-8 に変換してみていただけますか? https://superuser.com/questions/90449/repair-encoding-of-id3-tagsまたはhttp://code.google.com/p/id3-to-unicode/を参照してください。

于 2012-08-04T21:06:57.200 に答える