Allegro Posted September 6, 2007 Posted September 6, 2007 I trying to automate a software install that requires information entered into some dialog boxes during the install. For example server names and product codes. These are all ascii strings. I can get the windows info for the box, just need to know how to add the required text in the fields. Thanks.
silvano Posted September 6, 2007 Posted September 6, 2007 I trying to automate a software install that requires information entered into some dialog boxes during the install. For example server names and product codes. These are all ascii strings. I can get the windows info for the box, just need to know how to add the required text in the fields. Thanks. search func for Chr ( ASCIIcode ) and Send ( "keys" [, flag] )
Allegro Posted September 6, 2007 Author Posted September 6, 2007 search func for Chr ( ASCIIcode ) and Send ( "keys" [, flag] ) There is more than one field that needs to be filled in. How do you apply a specific string to a specific field? Thanks.
silvano Posted September 6, 2007 Posted September 6, 2007 There is more than one field that needs to be filled in. How do you apply a specific string to a specific field? Thanks. you must get, with AutoIT windows Info, the class/edit in the windows gui. watch window management in the help file WinTextMatchMode (Option) and Advanced Window Descriptions like this If WinWaitActive("[TITLE:My Window; CLASS:Edit; INSTANCE:2]", "") Then Send("{ASC 065}") EndIf
silvano Posted September 6, 2007 Posted September 6, 2007 (edited) like this? expandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("gui", 384, 259, 193, 115) $Input1 = GUICtrlCreateInput("", 32, 64, 121, 21) $Input2 = GUICtrlCreateInput("", 216, 64, 121, 21) $Input3 = GUICtrlCreateInput("", 120, 144, 121, 21) $send = GUICtrlCreateButton("send", 128, 200, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() if $nMsg <> "" And $nMsg <> 0 Then Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $send If WinExists("gui", "") Then ControlFocus("gui", "", "Edit1") ControlSend("gui", "", "Edit1", "Edit 1") ControlFocus("gui", "", "Edit2") ControlSend("gui", "", "Edit2", "Edit 2") $text = "" For $i = 65 to 90 $text = $text & Chr($i) Next ControlFocus("gui", "", "Edit3") ControlSend("gui", "", "Edit3", $text) EndIf EndSwitch EndIf WEnd Edited September 6, 2007 by silvano
Allegro Posted September 6, 2007 Author Posted September 6, 2007 silvano, Thanks for the help on this. I will try to have a look at it soon... Real work gets in the way sometimes....
Allegro Posted September 6, 2007 Author Posted September 6, 2007 silvano,Thanks for the help on this. I will try to have a look at it soon... Real work gets in the way sometimes....ControlFocus("GUI", "", "Edit2")ControlSend("GUI", "", "Edit2", "Edit 2")It Worked! It placed the text Edit 2 into the field Edit2.The next question is a bit trickier -- If text already exits in the field, how can it be deleted or overwritten with the new?This might be the case with certain installs of software, where an older version has already been setup...Thanks, much appreciated!
silvano Posted September 8, 2007 Posted September 8, 2007 ControlFocus("GUI", "", "Edit2") ControlSend("GUI", "", "Edit2", "Edit 2") It Worked! It placed the text Edit 2 into the field Edit2. The next question is a bit trickier -- If text already exits in the field, how can it be deleted or overwritten with the new? This might be the case with certain installs of software, where an older version has already been setup... Thanks, much appreciated! try this ControlFocus("gui", "", "Edit2") ControlSend("gui", "", "Edit2", "+{HOME}{DEL}")
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