--Save List
-- flush out any remnants
sExport = "";
sVisible = ""; 
sHidden = "";
-- Path to PlayList File
sPlayListFile = "AutoPlay\\Docs\\All-Media.txt";
	nListBoxRows = ListBox.GetCount("ListBox1");
	if nListBoxRows ==0 then
		Dialog.Message("Notice", "List Is Empty,\r\nNothing is Saved.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
	else
		for i=1,nListBoxRows do
			sVisible = ListBox.GetItemText("ListBox1", i);
			sHidden = ListBox.GetItemData("ListBox1", i);
			sExport = sVisible.."|"..sHidden;	
			if i==1 then
		TextFile.WriteFromString(sPlayListFile, sExport, false); --this will overwrite old data
			else 
		sExport = "\r\n"..sExport; -- make sure to append on a new line after the old data is overwritten
					TextFile.WriteFromString(sPlayListFile, sExport, true);
	end end end	
	