idiogene
10-02-2006, 02:53 PM
Hi,
I'm trying to populate a listbox with an m3U (playlist) file. The purpose of this is to pick and launch a song from that listbox in the media player.
The script I use is:
function playlist()
ListBox.DeleteItem("ListBox1",-1);
tbFiles = TextFile.ReadToTable();
for i,v in tbFiles do
ListBox.AddItem("ListBox1", String.SplitPath(v).Filename, v);
end
end
Every things work fine with the script except that the list include with each song a line of caractere that I wish to eliminate. In the example below these lines start by #EXTINF...
ex:
#EXTM3U
#EXTINF:248,Bill Evans - Nancy (with the Laughing Face)
Bill Evans - Nancy (with the Laughing Face)
#EXTINF:351,Bill Evans - Nardis
Bill Evans - Nardis
#EXTINF:490,Bill Evans - No Cover, No Minimum
Bill Evans - No Cover, No Minimum
etc.
I found a tread in this forum arguing that AMS could ignore lines with # at the beginning of the line. Could anyone help me with the necessary code to do so that the result will appear like this in the listbox.
Bill Evans - Nancy (with the Laughing Face)
Bill Evans - Nardis
Bill Evans - No Cover, No Minimum
etc.
Thanks
D.
I'm trying to populate a listbox with an m3U (playlist) file. The purpose of this is to pick and launch a song from that listbox in the media player.
The script I use is:
function playlist()
ListBox.DeleteItem("ListBox1",-1);
tbFiles = TextFile.ReadToTable();
for i,v in tbFiles do
ListBox.AddItem("ListBox1", String.SplitPath(v).Filename, v);
end
end
Every things work fine with the script except that the list include with each song a line of caractere that I wish to eliminate. In the example below these lines start by #EXTINF...
ex:
#EXTM3U
#EXTINF:248,Bill Evans - Nancy (with the Laughing Face)
Bill Evans - Nancy (with the Laughing Face)
#EXTINF:351,Bill Evans - Nardis
Bill Evans - Nardis
#EXTINF:490,Bill Evans - No Cover, No Minimum
Bill Evans - No Cover, No Minimum
etc.
I found a tread in this forum arguing that AMS could ignore lines with # at the beginning of the line. Could anyone help me with the necessary code to do so that the result will appear like this in the listbox.
Bill Evans - Nancy (with the Laughing Face)
Bill Evans - Nardis
Bill Evans - No Cover, No Minimum
etc.
Thanks
D.