コンピューター間でプレイリストの同期を維持するためのスクリプトを作成しています。
私はapplescriptを介してそれを行うと考えました。
前半は、m3u へのエクスポートで、これに行き詰まっています。
コードは次のとおりです。
property delimiter_character : " - "
tell application "iTunes"
set this_playlist to playlist "Alternative Mixtape"
set this_name to (the name of this_playlist) as string
set the playlist_count to the count of tracks of this_playlist
set playlist_data to {}
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set the end of the playlist_data to {name, delimiter_character, artist, return, location, return}
end tell
end repeat
end tell
end tell
set FileName to "Path:To:File.m3u"
set theFile to open for access FileName with write permission
write playlist_data to theFile
close access theFile
問題は、あらゆる種類の「文字化けした」出力が得られることです。
listlistutxt Hips Of The Yearutxt - utxtMistutxt
alisvvHDD…ÏXËH+Ï›Hips Of The Year.mp3χ»g∏mMp3 hookˇˇˇˇ Bye Bye…Ï<»»gúMϛϋ’.HDD:Music:Mist:Bye Bye:Hips Of The Year.mp3*Hips Of The Year.mp3HDD(/Music/Mist/Bye Bye/Hips Of The Year.mp3
クリップボードをプレーン テキストに変換しようとしましたが、クラス UTF8 またはレコードとしてコピーしようとするとエラーが発生し続けます。