myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);  
LB = "ListBox1";
-- Show the file browse dialog 
sFolder = Dialog.FolderBrowse("Open Folder", myfolder);  
if sFolder ~= "CANCEL" then
tbSearchFiles = {"*.cda","*.wma","*.wav","*.ogg","*.mp1","*.mp2","*.mp2v","*.mp3","*.mp4","*.aac","*.raw","*.aif", "*.aiff","*.mid","*.midi","*.avi","*.asf","*.asx","*.wax", "*.wmv", "*.wvx", "*.wmp", "*.wmx", "*.mpg", "*.mpeg", "*.m1v","*.mpa","*.mpe","*.vmd","*.mpv","*.png","*.jpg","*.jpeg","*.bmp","*.gif","*.mpv2","*.wmd","*.mov","*.divx","*.avc","*.mkv","*.xvid","*.3gp","*.flv","*.vob","*.rmvb","*.m4v","*.3g2","*.dat","*.ts","*.nsv","*.mts","*.m2ts","*.xwmv","*.mjpeg","*.mjpg","*.dif","*.dv","*.nut","*.qt","*.yuv","*.h.264","*.h.261","*.h.264","*.rm","*.ra","*.ogv","*.ape","*.flac","*.au","*.mp3pro","*.mpc","*.amr","*.m4r","*.m4b","*.cue","*.ram","*.ace"};
	-- tbSearchFiles = {"*.mp3","*.ogg","*.wma","*.wav","*.*"};
	for index,type in tbSearchFiles do
       file = File.Find(sFolder, type, false, false, nil);      
       	if file ~= nil and file ~="CANCEL" then		
              --do the following for each file:
            for j,file_path in file do
                     --add the item to the listbox, with the name visible and path as data
                     tbFilePath = String.SplitPath(file_path);
                     sFile = tbFilePath.Filename..tbFilePath.Extension;
                     ListBox.AddItem(LB, sFile, file_path); 
end end end end
	


