Jump to content
Sign in to follow this  
ev77

ControlSend problem

Recommended Posts

ev77

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

Share this post


Link to post
Share on other sites
AlmarM

Try adding some Sleep().

Edited 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.

Share this post


Link to post
Share on other sites
ev77

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).

Share this post


Link to post
Share on other sites
enaiman

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 :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×