Jump to content

First TIme User- Pretty Cool, but...


Recommended Posts

I've been able to successfully automate a simpl application, that has one button, and one text box.

I'm pretty happy with AuoIt so far.

However, When I send text to a Visual Basic Text Box control in my application, using

ControlFocus( "My App", "", 1) ; SET FOCUS TO THE TEXT BOX

Send("Todays date/Time: " & _Now() ) ; PUT THE DATE & TIME IN THE TEXT BOX

The text, Date & time DO appear in the text box, but the characters appear very slowly, almost like each character was sent one at a time, with a 50ms (or so) delay between each character.

This isn't causing a problem with my script, I just want to know if this is normal, and why the Send() is slow slow.

thanks

Link to comment
Share on other sites

Even another alternative: I believe that you can use ControlSetText(). This would be the cleanest and most efficient method because it would not touch the clipboard, it would be instantaneous and it would not require the control to be focussed.

Link to comment
Share on other sites

Even another alternative: I believe that you can use ControlSetText(). This would be the cleanest and most efficient method because it would not touch the clipboard, it would be instantaneous and it would not require the control to be focussed.

<{POST_SNAPBACK}>

Thanks to all who replied- Great ideas. Being new to the program, there's a world of new things to discover!!
Link to comment
Share on other sites

  • 3 weeks later...
Guest ktyler

The clipboard method seems to be the reliable way to go. It is much faster than Send() or ControlSend(). Clearly SendKeyDelay is not the problem here (5 ms is not going to cause the sort of delay you get, and dropping it to 1 ms is only going to take away an unnoticeable 4 ms difference. The delay between characters with Send() or ControlSend() is more like 800 ms.)

ControlSetText() isn't always an option. I notice that not all controls are addressable, at least in some Web applications. For example, you can't get ControlIDs for most web form elements in IE. You can get select boxes, but not buttons or text boxes.

I had to cook up a kludge where I send two TAB characters to move the keyboard focus to the appropriate form element, then spit out the input text. The downside of this is that I have to make sure I start the script with the focus in the default place.

Link to comment
Share on other sites

The clipboard method seems to be the reliable way to go. It is much faster than Send() or ControlSend(). Clearly SendKeyDelay is not the problem here (5 ms is not going to cause the sort of delay you get, and dropping it to 1 ms is only going to take away an unnoticeable 4 ms difference. The delay between characters with Send() or ControlSend() is more like 800 ms.)

ControlSetText() isn't always an option. I notice that not all controls are addressable, at least in some Web applications. For example, you can't get ControlIDs for most web form elements in IE. You can get select boxes, but not buttons or text boxes.

I had to cook up a kludge where I send two TAB characters to move the keyboard focus to the appropriate form element, then spit out the input text. The downside of this is that I have to make sure I start the script with the focus in the default place.

<{POST_SNAPBACK}>

or you could just use dale's ie.au3 for interaction with IE forms etc. good stuff, you should search the forum for it, there are links all over the place to it.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...