Код скрипта Get.au3

Код:
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
$mainwindow = GUICreate("Wget - закачка файлов", 350, 200)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Графическая оболочка к консольной программе Wget.exe", 10, 3)

$URL = GUICtrlCreateEdit ( ClipGet ( ),  5, 20, 340, 40, $ES_CENTER+$ES_MULTILINE)

GUICtrlCreateGroup ( "Пути", 5, 60, 340, 95)

GUICtrlCreateLabel("Путь к программе", 10, 75)
$WgetPath = GUICtrlCreateEdit ( "Укажите путь к программе",  10, 90, 300, 20, $ES_READONLY+$WS_HSCROLL)
$WgetButton = GUICtrlCreateButton ( "xxx", 311, 90, 30, 20)

GUICtrlCreateLabel("Путь к результату", 10, 115)
$OutPath = GUICtrlCreateEdit ( "Укажите директорию",  10, 130, 300, 20, $ES_READONLY+$WS_HSCROLL)
$PathButton = GUICtrlCreateButton ( "xxx", 311, 130, 30, 20)

$okbutton = GUICtrlCreateButton("Закачать!", 270, 160, 77, 40)

GUICtrlSetOnEvent($WgetButton, "WgetButton")
GUICtrlSetOnEvent($PathButton, "PathButton")
GUICtrlSetOnEvent($okbutton, "OKButton")

	GUICtrlSetData ( $WgetPath, IniRead ( @WindowsDir & "\Autoit.ini", "Wget", "WgetPath", ""))
	GUICtrlSetData ( $OutPath, IniRead ( @WindowsDir & "\Autoit.ini", "Wget", "OutPath", ""))

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Idle around
WEnd

Func WgetButton()
	$var = FileOpenDialog ( "Указать пусть к кодеру", "", "Исполняемый файл (Wget.exe)", 1)
	if StringLen ($var) > 0 then GUICtrlSetData ( $WgetPath, $var)
EndFunc

Func PathButton()
	$var = FileSelectFolder ( "Директория с файлами", "", 0)
	if StringLen ($var) > 0 then GUICtrlSetData ( $OutPath, $var)
EndFunc


Func OKButton()
	Run('"' & GUICtrlRead ($WgetPath) & '" -input --cookies=off --header -nH --user-agent="Microsoft Internet Explorer 5.0" --server-response --debug -c -nr -b -nd ' & GUICtrlRead ($URL), GUICtrlRead ($OutPath))
	CLOSEClicked ()
EndFunc

Func CLOSEClicked()
	IniWrite ( @WindowsDir & "\Autoit.ini", "Wget", "WgetPath", GUICtrlRead ($WgetPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "Wget", "OutPath", GUICtrlRead ($OutPath) )
    Exit
EndFunc