How-To: Playlist exporting from iTunes
I recently(well a few months ago) bought a Motorola Droid as an upgrade to my old phone. I must say I love it, and the fact it came with a 16gb SD card means I can replace my iPod. After starting the transition I realized it cannot read the playlist file type that iTunes uses(though I should be surprised.) After about a week of searching I found this script. For the record I have never used TCL nor do I know any of the syntax for it. Thankfully with jEdit I opened it up and learned a bit of the code(at least as far as what I am gonna explain.)
Most programs and mp3 players uses either .m3u or .pls format for the playlist, and the Droid specifically uses an older version of .pls. I will only go into the specifics of the Droid as it is slightly different format than other .pls files. I have a modified version of the script that eliminates two lines from the pls section. Droid only needs to know the file location for it to understand the playlist. As I said earlier I don’t know TCL and as such when the script spits out the final .pls I have to go in and replace part of the location to the relative path I have for my Droid. Thank god for find/replace eh?
Anyhow, you will need to install TCL dev kit in order for this script to work, as well as setting up environment variables to get command prompt to work. Go here to get your TCL install it and set up your variables. Once that is finished you will need to open up a new command prompt and get to wherever you saved your script. In the command prompt type “tclsh85 itunes_playlist_export.tcl”. If everything works you should get a listing of the commands you can use. Type “tclsh85 itunes_playlist_export.tcl list” and it will list all of your current playlists. It is important you do that first as the numbers to the left of the playlist names are used for the next step. Next type “tclsh85 itunes_playlist_export.tcl export (playlist number) (filename with extention) pls”. So say I want to export the 5th playlist in the populated list as a file named playlist.pls I would type “tclsh85 itunes_playlist_export.tcl export 5 playlist.pls pls”, the script will save the file in the SAME location as the script itself is stored. So if you have it saved on your desktop it will put the file on your desktop. Open up the file in your favorite editor(jEdit here) and you now have a nice looking .pls playlist, with one problem. You have direct path names leading to the files as if they were on your computer. Not good, we want relative paths.
The files you put on your device(or Droid) needs to be in the same folder structure as iTunes has. So if you have iTunes organize the folder it should be something like ..\Music\iTunes\iTunes Music\[Artist]\[Album]\[file].mp3 for my Droid I have everything in the iTunes Music in a folder called music. So when I replace the direct path (up to iTunes Music) with a relative path it looks something like \music\[Artist]\[Album]\[file].mp3. Easy as Pi! The .pls files should go in the same folder as where you put your music. So there you have it!
Ask any questions in the comments or shoot me an email.