This post was initially published on August 2, 2015.

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

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 adata as UTF-8 string
write "some album name with funny characters" as «class utf8» to fileRef
Write text data as UTF-8 to a file

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 the future.

My problem with iCloud Music Library is mostly duplicate songs appearing in the same album (annoying). Thankfully, no songs have gone missing from my local iTunes Music library yet.