Takashi Yoshida
Takashi Yoshida

Categories

  • blog

Tags

  • applescript
  • mac
  • itunes

After experiencing my own shares of iCloud Music Library problems, I decided to see if any songs are missing from my iTunes library. I began to write a script to dump album names that are missing songs from my iTunes library.

It appears that AppleScript writes text data as ASCII string (to a file) by default. This caused some album names to be written incorrectly to a file.

In order to write text data as UTF-8 string, you need to add as «class utf8».

-- write text data as ASCII string
write "some album name with funny characters" to fileRef

-- write text data as UTF-8 string
write "some album name with funny characters" as «class utf8» to fileRef

Press option + \ to enter « and option + shift + \ to enter ». I wish that write command will write text data as UTF-8 string by default in future.

P.S. My problem with iClould Music Library is mostly duplicate songs appearing in the same album. Thankfully, no songs are missing from local iTunes library yet.