wooddy Posted August 20, 2007 Share Posted August 20, 2007 Does anyone know how to select an input box on a form then send it some keystrokes? For example, a form contains three input box (First name, Last name, SSN). I would like to be able to place the cursor inside the input box for one of the above mentioned fields based on the input box name then send it keystrokes. Link to comment Share on other sites More sharing options...
Gif Posted August 20, 2007 Share Posted August 20, 2007 Does anyone know how to select an input box on a form then send it some keystrokes?For example, a form contains three input box (First name, Last name, SSN). I would like to be able to place the cursor inside the input box for one of the above mentioned fields based on the input box name then send it keystrokes.ControlFocus() then you can use ControlSend() or Send() Link to comment Share on other sites More sharing options...
wooddy Posted August 20, 2007 Author Share Posted August 20, 2007 ControlFocus() then you can use ControlSend() or Send()Thanks for your reply. Link to comment Share on other sites More sharing options...
wooddy Posted August 20, 2007 Author Share Posted August 20, 2007 ControlFocus() then you can use ControlSend() or Send()How do you get the control ID on the form? Link to comment Share on other sites More sharing options...
Gif Posted August 20, 2007 Share Posted August 20, 2007 (edited) How do you get the control ID on the form?(AutoIt folder)\Au3Info.exe, select the window you want and the controlId would be Class & Instance, more infos about it here and here Edited August 20, 2007 by Gif Link to comment Share on other sites More sharing options...
wooddy Posted August 21, 2007 Author Share Posted August 21, 2007 (AutoIt folder)\Au3Info.exe, select the window you want and the controlId would be Class & Instance, more infos about it here and hereHi, I used the AU3Info utility to get the class and id of the control but I am still not able to interact with the control.Attached are .bmp code AU3Info results. Link to comment Share on other sites More sharing options...
wooddy Posted August 21, 2007 Author Share Posted August 21, 2007 (AutoIt folder)\Au3Info.exe, select the window you want and the controlId would be Class & Instance, more infos about it here and here My previous reply did not have the attachments. The upload exceeded the limit. Here's my code: Set IE = New InternetExplorer Set AI = New AutoItX3 If AI.WinExists("Smith Bits S.T.A.T.S.") Then AI.WinActivate ("Smith Bits S.T.A.T.S.") AI.ControlFocus "Smith Bits S.T.A.T.S.", "", "[CLASS:ComboLbox; INSTANCE:1]" AI.ControlCommand "Smith Bits S.T.A.T.S.", "", "[CLASS:ComboLbox; INSTANCE:1]", "ShowDropDown", "" Else IE.Navigate "http://www.smith.com/stats/new/index.asp" IE.Visible = True End If Link to comment Share on other sites More sharing options...
DaleHohm Posted August 21, 2007 Share Posted August 21, 2007 Is it controls HTML in IE you are trying to interact with or a native GUI? Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble 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