Create custom CD label inserts using cdlabelgen

Feb 17, '04 09:52:00AM

Contributed by: yoyoregime

After ripping my music collection from CDs with iTunes I quickly realized that I was running out of disk space on my iBook. I found some nifty AppleScripts on Doug's AppleScripts for iTunes that helped me make MP3 CDs of my music collection. Look for the ones titled "Backup Selection or Playlist to MP3 CD" and "Make BackUp MP3 CD" on the linked page.

After making my backups, I wanted to create some inserts which would include information on the tracks for each CD. Coming from the Linux world, I was already familiar with a nice perl script called cdlabelgen. You can create inserts for both the normal and slim jewel cases as well as envelopes to hold your CDs. Installing the script on Mac OS X is not that difficult if you are familiar with UNIX commands. I installed the program in /opt/. You should consult the README and INSTALL files which are included in the source.

The script cdlabelgen> takes a text file as input. This input file contains the information which you wish to print on the back of each insert. I used some AppleScripts to extract the relevant information (Artist, Album, Title) from the MP3 files to a text file. Doug's AppleScripts for iTunes has some good AppleScripts for doing this. You can find them right here. I then edited the text files manually to include some formatting tags (see Example 3 on the cdlabelgen web page). An example of an input file can be found right here.

There are many parameters one can pass to cdlabelgen, as explained in the online man page. I like to make CD envelopes with an image of the iTunes icon on the cover. The following UNIX command creates an envelope for a CD titled "MP3s: iTunes CD 1". The input is a file called cdinput.txt and the output is a postscript file called jewelcase.ps:


 % /opt/bin/cdlabelgen -c "MP3's: iTunes CD 1" -e 'itunes.ps2' -S '1.8,-1.5,1' \
   -f cdinput.txt -D -M -v 0 -b --plaque-color 230,230,230 \
   --category-color 045,147,048 -o jewelcase.ps
Note that the command above should be all on one line. Also the command assumes that you have a PostScript file called itunes.ps2 in your working directory. I found an iTunes image by searching on Google and then I converted it to a PostScript file using Imagemagick (installed via Fink). The image for cdlabelgen has to be a PostScript file.

I then converted the output file to PDF using ps2pdf (also installed via Fink). Here is an example of what the final product looks like. Print, cut, glue and enjoy!

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040209134611945