Jump to content

Recommended Posts

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 post
Share on other sites

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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...