This hint is useful if you want to zip many tracks of music located in your iTunes Library, belonging to different albums by different artists. For instance, you might want to use such a method to create a single backup file. Or for transferring your music to a second computer. I'll assume you have already nicely arranged the songs of interest in a playlist. You can then burn them on a CD, but can you zip them instead? You can, but one annoying problem is those pesky accents, umlauts, and other exotic characters (including the /) that plague titles and artists' names, particularly if you enjoy international music. Fortunately, iTunes uses Unicode characters, and this is one way to deal with them:
./iTunes_to_zip.rb /path/to/exported/playlist.txt name_of_archive_to_create.zip
Replace /path/to/exported/playlist.txt and name_of_archive_to_create.zip, obviously. That's it. You will have a new .zip file that contains all the tracks of your playlist.
The script (a Ruby one, ideal for this task) simply manipulates the file playlist.txt to create a list of locations (separated by spaces) of all the tracks in your playlist and then archives them using this command:
zip -v name_of_archive_to_create.zip /Users/...mp3 /Users/...mp3 etc.
Two warnings:
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070523111218322