Version 6 of generating a playlist using itunesdb

Updated 2006-02-07 02:48:59

AMG created a wonderful utility called itunesdb which allows you to retrieve information from an ipod in regards to the music stored on it.

Below is just one example of how to utilize the itunesdb package:

Jeremy Miller - There seems to be some difference functionally between 0.10 and 0.40, so the script below is made with 0.10 in mind, and will be updated later.


 #!/usr/bin/tclsh
 package require itunesdb
 set ::basepath "d:"
 proc genlist {} {
  itunesdb db $::basepath/iPod_Control/iTunes/iTunesDB
  db seek track
  set ::fp [open playlist.m3u w+]
  while {[db remaining]} {
   array set track [db read]
   puts $::fp "$::basepath[string map {: /} $track(ipod_path)]"
  }
  close $::fp
  db destroy
  puts done
 }
 genlist

Simply change ::basepath to where your ipod is mounted, and run the script. The script will generate a file called playlist.m3u in the same directory it is stored in, hopefully allowing you to play the music from your ipod over your pc. More features, possibly, to come.