Creating playlists for your music by folders structure
Posted in random | by eitama |Recently I was looking into ways to control music being played on the computer
from my N95, I wrote an application that connects over bluetooth and wifi to your computer
and send signals to the computer…
One of those signals is load XXX playlist, as i currently have more then 50 folders of music,
I was looking for a script to generate a playlist for each folder. (Winamp playlist).
But, I could not find one, so I wrote one ![]()
(Written in tcl, run this inside your music folder)
|proc itterateFolder {} {
|Â Â Â set rawFolders [glob -type d *]
|Â Â Â set folders []
|Â Â Â set root [pwd]
|Â Â Â foreach x $rawFolders {
|Â Â Â Â Â Â if {[regexp -- {[a-zA-Z0-9]} $x]} {
|Â Â Â Â Â Â Â Â Â cd $x
|Â Â Â Â Â Â Â Â Â puts [pwd]
|Â Â Â Â Â Â Â Â Â catch {exec cmd /c dir /b *.mp3 > $x.m3u}
|Â Â Â Â Â Â Â Â Â if {![catch {glob -type d *}]} {
|Â Â Â Â Â Â Â Â Â Â Â Â itterateFolder
|Â Â Â Â Â Â Â Â Â }
|Â Â Â Â Â Â Â Â Â cd $root
|Â Â Â Â Â Â }
|Â Â Â }
|}
|
|itterateFolder
Cheers.
EItam.