ev77 Posted February 23, 2012 Share Posted February 23, 2012 The ControlSend in the script below Intermittently seems to send incorrect text to the control. Sometimes it works great, other times a single character will be incorrect, while still other times only part of the string is received by the control. I don't want to think it is a hardware problem because I am not having such symptoms with anything else. Thanks so much for any help. WinWaitActive("Clubber Export options") controlclick("Clubber Export options","Ok","[CLASS:Button; INSTANCE:1]") ;Click Ok -to accept the defaults ControlCommand ("Clubber Export options","", "[CLASS:ComboBox; INSTANCE:1]", "SetCurrentSelection", 0) ;Set Group Type to blank Controlclick("Clubber Export options","Export","[CLASS:Button; INSTANCE:23]") ;Click Export button winwaitactive("Save As") ;Wait for the file save window ControlSend ("Save As","","[CLASS:Edit; INSTANCE:1]","D:\Ark Reports\Clubber Export.csv") controlclick("Save As","Save","[CLASS:Button; INSTANCE:2]") ;Click Save Link to comment Share on other sites More sharing options...
AlmarM Posted February 23, 2012 Share Posted February 23, 2012 (edited) Try adding some Sleep(). Edited February 23, 2012 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
ev77 Posted March 2, 2012 Author Share Posted March 2, 2012 I did try adding sleeps and it seemed to help but not eliminate the problem. Perhaps you can tell me where to add them and how long to make them. Is there any way to slow down ControlSend so it sends text slower? Would that help? Why does it like to change : to ; and change \ to | and change the case of letters? Seems like it is messing up on the shift key. Is it then simulating keystrokes rather than sending ASCII codes? It would seem that Windows would provide a way to sent text directly to a control without simulating key strokes. Also is there another more reliable way to sent text to a control - in particular to send a file path/name to a file save control. That's where almost all the problem is (in the scripts I am working with now). Link to comment Share on other sites More sharing options...
enaiman Posted March 2, 2012 Share Posted March 2, 2012 If the problem is usually with a path name (an input-like control) you might try using ControlSetText. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) 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