--dofile(_SourceFolder.."\\AutoPlay\\Scripts\\LoadP.lua");
--[[ *** *** *** *** *** *** *** *** *** *** *** *** *** ]]--
--[[ *** This code contains a very important fnction *** ]]--
--[[ *** that is used in PlayMeNow. Do not touch!    *** ]]--
--[[ *** If you are really good in AMS & LUA then    *** ]]--
--[[ *** you can make any changes, but be careful!   *** ]]--M3U 
--[[ *** *** *** *** *** *** *** *** *** *** *** *** *** ]]--

-- ask for the path of the playlist and load it
FilePath = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "Playlist|*.m3u|XML Playlist|*.xml|", "", "", false, true);
-- make sure that cancel was not pressed
if FilePath[1] ~= "CANCEL" then
ListBox.DeleteItem("ListBox1", -1);
	-- read the contents
	play_file = TextFile.ReadToTable(FilePath[1]);
	-- make sure it's not empty
	if play_file ~= nil then
		for j,Path in play_file do
			-- get the file name and add it to the playlist
			file_name = String.SplitPath(Path).Filename;
			ListBox.AddItem("ListBox1", file_name, Path);
			
end	end	end
	
