Andy2520 Posted December 14, 2013 Share Posted December 14, 2013 Dear Team, I have created the below GUI which take the file path from user inputs .And store the input path into the one variable that i am going to be use in entire script . Problem is the i am unable to read the input path which has enter by the user please help . If the input path is empty scipt should ask the user "Cant be blank message " #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Idfile() Func Idfile() $hGUI1 = GUICreate("Lotus Notes Auto Config ", 394, 142, -1, -1) $hLabel1 = GUICtrlCreateLabel("Select Notes ID file ", 98, 16, 142, 27) GUICtrlSetFont(-1, 10, 800, 0) $hButton1 = GUICtrlCreateButton("Browse", 53, 92, 96, 23) GUICtrlSetFont(-1, 10, 800, 0) $hButton21 = GUICtrlCreateButton("Done", 229, 92, 95, 23) GUICtrlSetFont(-1, 8.5, 800, 0) $path = GUICtrlCreateInput("", 19, 43, 349, 27) GUISetState() $hMsg1 = 0 While $hMsg1 <> $GUI_EVENT_CLOSE $hMsg1 = GUIGetMsg() Select Case $hMsg1 = $hButton1 $File2open = FileOpenDialog("Browse", "C:\", "ID file (*.txt)") ;returns the file path GUICtrlSetData($path, $File2open) ;set input data $test = GUICtrlSetData($path, $File2open) Case $hMsg1 = $hButton21 MsgBox(1,"ID File Location",$test ) ;GUIDelete($delwindow) Return EndSelect WEnd EndFunc ;==>Idfile Link to comment Share on other sites More sharing options...
Solution mikell Posted December 14, 2013 Solution Share Posted December 14, 2013 Case $hMsg1 = $hButton21 $file = GuiCtrlRead($path) If $file = "" Then Msgbox(0, "", "Cant be blank message") Else MsgBox(1,"ID File Location", $file ) EndIf Andy2520 1 Link to comment Share on other sites More sharing options...
Andy2520 Posted December 14, 2013 Author Share Posted December 14, 2013 Thanks its working fineeee 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