cappy2112 Posted July 13, 2005 Share Posted July 13, 2005 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 More sharing options...
layer Posted July 13, 2005 Share Posted July 13, 2005 Try putting this at the top of your script: Opt("SendKeyDelay", 1) It should be somewhat faster... FootbaG Link to comment Share on other sites More sharing options...
buzz44 Posted July 13, 2005 Share Posted July 13, 2005 (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 July 13, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
LxP Posted July 13, 2005 Share Posted July 13, 2005 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 More sharing options...
cappy2112 Posted July 13, 2005 Author Share Posted July 13, 2005 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 More sharing options...
w0uter Posted July 13, 2005 Share Posted July 13, 2005 world ? theres a universe. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Guest ktyler Posted August 3, 2005 Share Posted August 3, 2005 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 More sharing options...
seandisanti Posted August 3, 2005 Share Posted August 3, 2005 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 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