SWB Posted March 27, 2012 Share Posted March 27, 2012 (edited) I did this small GUI for my own use for WinRAR, When I go to run it, the script errors out, no matter what I try, what am I doing wrong? Script is attached. This is uses a command line in the script. Thanks, #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Global $Program = 'C:Program FilesWinRAR' Dim $msg, $fsf Dim $guiHandle = GUICreate("RAR", 200, 135) GUICtrlCreateLabel('Name of RAR:' , 5, 5, 190) Dim $Name = GUICtrlCreateInput("", 5, 20, 165) GUICtrlCreateLabel('Archive File:' , 5, 50, 190) Dim $Arc = GUICtrlCreateInput("", 5, 65, 165) Dim $Folder = GUICtrlCreateButton( '...', 170, 65, 25, 22) Dim $rarbutton = GUICtrlCreateButton("Run RAR", 5, 108, 75) Dim $exitbutton = GUICtrlCreateButton("Exit", 120, 108, 75) GUISetState(@SW_SHOW, $guiHandle ) While 1 $msg = GUIGetMsg($guiHandle ) Select Case $msg == $GUI_EVENT_CLOSE Or $msg = $exitbutton Exit Case $msg == $Folder $fsf = FileSelectFolder('Choose Folder to Archive','') If Not @error Then GUICtrlSetData($Arc, $fsf) Case $msg == $rarbutton RunWait($Program & 'Rar.exe a -av -m5 -o+ -r -sfx' & GUICtrlRead($Name) & '.rar' & '' & GUICtrlRead($Arc) Case Default EndSelect WEndRAR.au3 Edited March 27, 2012 by SWB Link to comment Share on other sites More sharing options...
Country73 Posted March 27, 2012 Share Posted March 27, 2012 Before I even waste my time looking over your code, can you provide the error that you are getting? If you run the script in SciTE, it will show exactly where it is erroring out in the Output screen. If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
Mobius Posted March 27, 2012 Share Posted March 27, 2012 (edited) @SWB You are missing the right terminater for the RunWait function. RunWait($Program & 'Rar.exe a -av -m5 -o+ -r -sfx' & GUICtrlRead($Name) & '.rar ' & '' & GUICtrlRead($Arc)) In Scite if you are missing the terminator character the brace just after the function name will be green when the text caret is either side of it, when you have wrapped the function parameters properly both braces will be blue when the text caret is either side of them. (Colors used are the default) Also since this is Rar.exe's commandline you might benefit from wrapping any of the file name or file paths (yes including rar.exe) with double quotes to compensate for file paths that contain spaces. Vlad Edited March 27, 2012 by Mobius Link to comment Share on other sites More sharing options...
SWB Posted March 27, 2012 Author Share Posted March 27, 2012 @SWB You are missing the right terminater for the RunWait function. RunWait($Program & 'Rar.exe a -av -m5 -o+ -r -sfx' & GUICtrlRead($Name) & '.rar ' & '' & GUICtrlRead($Arc)) In Scite if you are missing the terminator character the brace just after the function name will be green when the text caret is either side of it, when you have wrapped the function parameters properly both braces will be blue when the text caret is either side of them. (Colors used are the default) Also since this is Rar.exe's commandline you might benefit from wrapping any of the file name or file paths (yes including rar.exe) with double quotes to compensate for file paths that contain spaces. Vlad The GUI opens the RAR CMD window but it just sits there and does nothing, blinking cursor. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now