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

Код:
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
$mainwindow = GUICreate("Мультиплексор MPV+MVA в VOB", 350, 250)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Графическая оболочка к консольной программе mplex.exe", 10, 3)

GUICtrlCreateGroup ( "Пути", 5, 20, 340, 225)

GUICtrlCreateLabel("Путь к мультиплексору", 10, 35)
$EncPath = GUICtrlCreateEdit ( "Укажите кодер",  10, 50, 300, 20, $ES_READONLY+$WS_HSCROLL)
$EncButton = GUICtrlCreateButton ( "xxx", 311, 50, 30, 20)

GUICtrlCreateLabel("Путь к файлу MPV", 10, 75)
$MPVPath = GUICtrlCreateEdit ( "Укажите файл",  10, 90, 300, 20, $ES_READONLY+$WS_HSCROLL)
$MPVButton = GUICtrlCreateButton ( "xxx", 311, 90, 30, 20)

GUICtrlCreateLabel("Путь к файлу MPA", 10, 115)
$MPAPath = GUICtrlCreateEdit ( "Укажите файл",  10, 130, 300, 20, $ES_READONLY+$WS_HSCROLL)
$MPAButton = GUICtrlCreateButton ( "xxx", 311, 130, 30, 20)

GUICtrlCreateLabel("Путь к результату (VOB)", 10, 155)
$VobPath = GUICtrlCreateEdit ( "Укажите директорию",  10, 170, 300, 20, $ES_READONLY+$WS_HSCROLL)
$VobButton = GUICtrlCreateButton ( "xxx", 311, 170, 30, 20)

$okbutton = GUICtrlCreateButton("Кодировать!", 260, 200, 77, 35)

GUICtrlSetOnEvent($EncButton, "EncButton")
GUICtrlSetOnEvent($MPVButton, "MPVButton")
GUICtrlSetOnEvent($MPAButton, "MPAButton")
GUICtrlSetOnEvent($VobButton, "VobButton")
GUICtrlSetOnEvent($okbutton, "OKButton")

GUICtrlCreateLabel("Смещение", 10, 195)
$Offset = GUICtrlCreateEdit ("", 10, 210, 40, 20, $WS_HSCROLL)

	GUICtrlSetData ( $EncPath, IniRead ( @WindowsDir & "\Autoit.ini", "mplex", "EncPath", ""))
	GUICtrlSetData ( $MPVPath, IniRead ( @WindowsDir & "\Autoit.ini", "mplex", "MPVPath", ""))
	GUICtrlSetData ( $MPAPath, IniRead ( @WindowsDir & "\Autoit.ini", "mplex", "MPAPath", ""))
	GUICtrlSetData ( $VobPath, IniRead ( @WindowsDir & "\Autoit.ini", "mplex", "VobPath", ""))
	GUICtrlSetData ( $Offset,  IniRead ( @WindowsDir & "\Autoit.ini", "mplex", "Offset", ""))

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Idle around
WEnd

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

Func MPVButton()
	$var = FileOpenDialog ( "Указать путь к MPV", "", "Видеоданные (*.mpv)", 1)
	if StringLen ($var) > 0 then GUICtrlSetData ( $MPVPath, $var)
    $var2 = StringLen ($var)
	if StringLen ($var) > 0 then GUICtrlSetData ( $MPAPath, StringLeft( $Var, $var2 - 4 ) & ".mpa")
	if StringLen ($var) > 0 then GUICtrlSetData ( $VobPath, StringLeft( $Var, $var2 - 4 ) & ".vob")
EndFunc

Func MPAButton()
	$var = FileOpenDialog ( "Указать путь к MPV", "", "Аудиоданные (*.mpa)", 1)
	if StringLen ($var) > 0 then GUICtrlSetData ( $MPAPath, $var)
EndFunc

Func VobButton()
	$var = FileSaveDialog ( "Указать путь к Vob", "", "DVD-Video (*.vob)", 1)
	if StringLen ($var) > 0 then GUICtrlSetData ( $VobPath, $var)
	if StringRight ($var, 4) <> ".vob"  then GUICtrlSetData ( $VobPath, $var & ".vob")
EndFunc

Func OKButton()
	Run('"' & GUICtrlRead ($EncPath) & '"' & ' -f 8 -O ' & GUICtrlRead ($Offset) & 'ms -o "' & GUICtrlRead ($VobPath) & '" "' & GUICtrlRead ($MPVPath) & '" "' & GUICtrlRead ($MPAPath) & '"')
	CLOSEClicked ()
EndFunc

Func CLOSEClicked()
	IniWrite ( @WindowsDir & "\Autoit.ini", "mplex", "EncPath", GUICtrlRead ($EncPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "mplex", "MPVPath", GUICtrlRead ($MPVPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "mplex", "MPAPath", GUICtrlRead ($MPAPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "mplex", "VobPath", GUICtrlRead ($VobPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "mplex", "Offset", GUICtrlRead ($Offset) )
    Exit
EndFunc