It works quite nicely, and even delineates into different discs and tracknumbers for files that are named to the etree standard. The only thing that it cannot do is fill in the cdplayer.ini filed called "numfiles". In order to do this, it would need to count the number of items in the playlist that match a certain criteria, say %disc%=1.
Is it possible to, in one line of a copy command, count the number of items in the playlist with a certain criteria, and put that number into the output text?
Editing to add my "copy command" text, in the hopes that someone can offer some advice.
CODE
//Get the disc number of the current track from the filename, works only for etree formatted files
$puts(disc,$substr(%_filename%,$sub($len(%_filename%),4),$sub($len(%_filename%),3)))
//Get the tracknumber on the currect disc from the filename, works only for etree formatted files
$puts(track,$substr(%_filename%,$sub($len(%_filename%),1),$len(%_filename%)))
$puts(DiscNum,
$if($stricmp($get(disc),'d2'),Disc 2,
$if($stricmp($get(disc),'d3'),Disc 3,
$if($stricmp($get(disc),'d4'),Disc 4,
$if($stricmp($get(disc),'d5'),Disc 5,
$if($stricmp($get(disc),'d6'),Disc 6,
$if($stricmp($get(disc),'d7'),Disc 7,
$if($stricmp($get(disc),'d8'),Disc 8,
$if($stricmp($get(disc),'d9'),Disc 9,
%album%)))))))))
//Entry will create the line. The comments below for "Line" are only grabbed if the file is deemed to be disc 1, track 1.
$puts(entry,$if($stricmp($num($get(track),2),01),$char(13)
//Line1: Generate a random hex number to "trick" cdplayer.ini into thinking a real CD has been scanned.
'['$hex($num($mod($rand(16777216)),2),2)']'$char(13)
//Line2: Get the artist from the file's tags
artist=%artist%$char(13)
//Line3: Get the album title from the file's tags
title=$get(DiscNum)$char(13)
//Line4: Write Numtracks, but leave blank until the proper number can be counted.
numtracks=$char(13)
//Fill in tracknumbers and song titles
$sub($num($get(track),2),1)=%title%,$sub($num($get(track),2),1)=%title%))
//Get Entry
$get(entry)