Sign in to follow this  
Followers 0
cappy2112

First TIme User- Pretty Cool, but...

8 posts in this topic

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

Share this post


Link to post
Share on other sites



Try putting this at the top of your script:

Opt("SendKeyDelay", 1)

It should be somewhat faster...


FootbaG

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You could also copy the text to the clip board then paste it.

ControlFocus( "My App", "", 1)
ClipPut("Todays date/Time: " & _Now())
Send("^v"); Ctrl + V (Paste)
Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
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.

Share this post


Link to post
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!!

Share this post


Link to post
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.

Share this post


Link to post
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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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  
Followers 0