alias -l tree {
var %dir = e:\mp3s\
write -c db.tmp
if ($fopen(mp3list)) { .fclose mp3list }
.fopen mp3list db.tmp
var %x = $finddir($+(",%dir,"),*,0,2,.fwrite -n mp3list $1- $+ \)
.fclose mp3list
var %n = 1
/run sort db.tmp /O db0.tmp
did -a $dname 401 \Mp3s
did -i $dname 401 1 cb root last 1
while (%n < $lines(db0.tmp)) {
var %line = $read(db0.tmp,%n)
if ($numtok(%line,92) <= 3) {
did -a $dname 401 $gettok(%line,2,58)
did -i $dname 401 1 cb root last 1
inc %n
}
if ($numtok(%line,92) >= 4) {
did -a $dname 401 $gettok(%line,2,58)
did -i $dname 401 1 cb root last last 1
inc %n
}
}
}