Dim $L
$L=GUIDialog("LOCATE 'PlayList.xml' file",$PADS,16386)
If @error=0 and left($L,12)='PlayList.xml'
if exist($L)
$source=$L
Else
Quit
Endif
Endif
;FUNCTION GUIDialog()
;
;AUTHOR Lonkero
;
;ACTION GUI for selecting folder/file/computer/printer...
;
;SYNTAX GUIDialog(TITLE,[ROOT][,MODE])
;
;PARAMETERS
; TITLE
; - Title to show in dialog
; ROOT
; - Optional. Specifies the root of the Browse dialog box.
; The user cannot browse higher in the architecture than this folder.
; If this value is not specified, the root of the Browse dialog box is the desktop.
; MODE
; - Optional. Changes the mode to show in dialog:
; 2 = Do not include network folders below the domain level in the dialog box's tree view control.
; 16 = Include an edit control in the browse dialog box that allows the user to type the name of an item.
; 4096 = Only return computers. If the user selects anything other than a computer, the OK button is grayed.
; 8192 = Only return printers. If the user selects anything other than a printer, the OK button is grayed.
; 16384 = The browse dialog box will display files as well as folders.
;
;RETURNS
; the full path to folder, or error if user pressed cancel.
;
;DEPENDENCIES Minimum operating systems: Windows 2000, Windows ME
;
;CODE
function GUIDialog($_title, optional $_root, optional $_mode)
dim $
$=createobject("shell.application")
$GUIDialog=$.BrowseForFolder(0,$_title,0+$_mode,$_root).self.path
if not len($GUIDialog) exit 1 endif
endfunction