spuri Posted November 18, 2008 Share Posted November 18, 2008 (edited) I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. How could I get Input1 value? ... $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22) ... $project = GUICtrlRead($Input1) Msgbox(0,"test", $project ) Msgbox(0,"test", $Input1 ) ... Edited November 20, 2008 by spuri Link to comment Share on other sites More sharing options...
Airwolf Posted November 18, 2008 Share Posted November 18, 2008 I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. How could I get Input1 value? ... $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22) ... $project = GUICtrlRead($Input1) Msgbox(0,"test", $project ) Msgbox(0,"test", $Input1 ) ... GuiCtrlRead is the proper function for capturing GUI input. Post the whole script and we can help find the problem. Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt Link to comment Share on other sites More sharing options...
Kerros Posted November 18, 2008 Share Posted November 18, 2008 I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. How could I get Input1 value? ... $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22) ... $project = GUICtrlRead($Input1) Msgbox(0,"test", $project ) Msgbox(0,"test", $Input1 ) ... Use the included inputbox function and then you will not need the GUICtrlRead to read the value of your inputbox. $input1 = InputBox("Blank input","Input something here:",'','','', 28, 125, 345, 22) MsgBox(0,'',$input1) Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance. Link to comment Share on other sites More sharing options...
zorphnog Posted November 18, 2008 Share Posted November 18, 2008 GUICtrlRead is the proper way to read it, but its impossible to tell whats wrong without your full script. Link to comment Share on other sites More sharing options...
FireFox Posted November 18, 2008 Share Posted November 18, 2008 Kerros is right : $input1 = InputBox("Blank input","Input something here","The text you want to read","","", 28, 125, 345, 22) MsgBox(0,"Read InputBox","The text write in inputbox is :"&$input1) Just use the constant of your inputbox Link to comment Share on other sites More sharing options...
spuri Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) thanks inputbox works with Kerros's example butnot with GUICtrlCreateInput $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22) I would like to xcopy d:\templateclient\tempproj dir to D:\{selected-dir-client}\tempproj full code expandcollapse popup#Region ### START Koda GUI section ### Form=c:\program files\autoit3\forms\mb01.kxf $Form1 = GUICreate("Project-R", 413, 305, 272, 188) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetIcon("D:\81.ico") $PageControl1 = GUICtrlCreateTab(8, 8, 396, 256) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("New Project") $Button2 = GUICtrlCreateButton("Create Project", 272, 208, 75, 25, 0) GUICtrlSetOnEvent(-1, "NewClientClick") GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Combo1 = GUICtrlCreateCombo("", 36, 77, 337, 25) GUICtrlSetOnEvent(-1, "Combo1Change") GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetFont(-1, 8, 400, 0, "Arial") ;---problem2---- !!!!!!!!!!!!!!! GUICtrlCreateInput("", 40, 168, 337, 22) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $TabSheet2 = GUICtrlCreateTabItem("New Client") ;---problem2---- $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlCreateTabItem("") $Exit = GUICtrlCreateButton("&Exit", 318, 272, 75, 25, 0) GUICtrlSetOnEvent(-1, "Exitclick") $input11 = InputBox("Blank input","Input something here:",'','','', 28, 125, 345, 22) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd ;------------------------------------Backup Button Function------------------------------------------- Func NewClientClick() $client = GUICtrlRead($Combo1) $project = GUICtrlRead($Input1) Msgbox(0,$project, $client ) EndFunc ;-------------------------------------End of Backup Button Function------------------------------------------ Edited November 20, 2008 by spuri Link to comment Share on other sites More sharing options...
FireFox Posted November 19, 2008 Share Posted November 19, 2008 (edited) thanks inputbox works with Kerros's example butnot with GUICtrlCreateInput $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22) GuiCtrlRead($Input1);Read the input I would like to xcopy d:\templateclient\tempproj dir to D:\{selected-dir-client}\tempproj DirCopy("D:\templateclient\tempproj","D:\"&GuiCtrlRead($Input1)&"\tempproj",flag) Edited November 19, 2008 by FireFox Link to comment Share on other sites More sharing options...
spuri Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) You are right but I need to copy ACL so probably xcopy is the answer and I still can not get the $Input1 value.why this does not work?Func NewClientClick() $project = GUICtrlRead($Input1) Msgbox(0,'test', $project ) EndFuncI get thisshould this variable be global? Edited November 19, 2008 by spuri Link to comment Share on other sites More sharing options...
spuri Posted November 19, 2008 Author Share Posted November 19, 2008 I get this (12) if I changed the code as belowFunc NewClientClick() GUICtrlRead($Input1) Msgbox(0,'test', $Input1 ) EndFunc Link to comment Share on other sites More sharing options...
khimik Posted November 19, 2008 Share Posted November 19, 2008 You are not looking at the right input box. In your code, the input you are looking for is on line 39. If you delete line 44, and assign input on line 39 to $Input1 [e.g., $Input1 = GUICtrlCreateInput("", 40, 168, 337, 22)], everything works OK. Link to comment Share on other sites More sharing options...
spuri Posted November 20, 2008 Author Share Posted November 20, 2008 (edited) ouccchh - many thaks - works fine Edited November 20, 2008 by spuri Link to comment Share on other sites More sharing options...
spuri Posted November 20, 2008 Author Share Posted November 20, 2008 (edited) this works also $RunP = RunWait( @ComSpec & " /c xcopy D:\_TemplateProject_0000\CLIENT D:\test\" & $client & "\ /T /E /O" ) Msgbox(0,"project-test", $RunP ) Edited November 20, 2008 by spuri 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