fred666777 Posted July 29, 2007 Share Posted July 29, 2007 im trying to send what the user types to notepad so if my program says your name:i want it torun("notepad.exe")WinWaitActive("Untitled - Notepad")Send("Hello 'what user typed in input box'")i have all of my code done but i cant get what is in the input box i triedSend("Hello $name")Send("Hello " $name)andSend("Hello "($name))but obviously they are all wrong... can someone please provide the right code? Link to comment Share on other sites More sharing options...
DW1 Posted July 29, 2007 Share Posted July 29, 2007 Send("Hello " & $name) AutoIt3 Online Help Link to comment Share on other sites More sharing options...
fred666777 Posted July 30, 2007 Author Share Posted July 30, 2007 (edited) didnt work now it gives me #'s here is a sample of what i am trying to do. #include <GUIConstants.au3> GUICreate("test", 265, 125, -1, -1) $name = GuiCtrlCreateInput("", 85, 2, 170, 20) $button1 = guictrlcreatebutton("test", 20, 30, 30, 20) $namelabel = GuiCtrlCreateLabel("Your Name:", 24, 5, 60, 20) GuiSetState () While 1 $msg = GUIGetMsg() Select Case $msg = $button1 Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("Hello " & $name) EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Edited July 30, 2007 by fred666777 Link to comment Share on other sites More sharing options...
Paulie Posted July 30, 2007 Share Posted July 30, 2007 To read the input of a Input control, use GuictrlRead. #include <GUIConstants.au3> GUICreate("test", 265, 125, -1, -1) $name = GuiCtrlCreateInput("", 85, 2, 170, 20) $button1 = guictrlcreatebutton("test", 20, 30, 30, 20) $namelabel = GuiCtrlCreateLabel("Your Name:", 24, 5, 60, 20) GuiSetState () While 1 $msg = GUIGetMsg() Select Case $msg = $button1 Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("Hello " & GUICtrlRead($name)) EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Works now 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