langthang084 Posted July 25, 2014 Share Posted July 25, 2014 my script like this: send(......) send(............................) send(.........) But my CPU is Intel Celeron 2Ghz, DDR RAM 512Mb, so when i use some send a long character string, it runs incorrectly So, is there anyway to use sleep(time) to make script stop until the send complete, then run the next send code (i dont want use time is number to avoid waste time) Link to comment Share on other sites More sharing options...
JohnOne Posted July 25, 2014 Share Posted July 25, 2014 it runs incorrectlyBe more clear. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jdelaney Posted July 25, 2014 Share Posted July 25, 2014 Don't use sends then. Use controlsettext. langthang084 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
langthang084 Posted July 25, 2014 Author Share Posted July 25, 2014 i want to use with "Find and Replace" in Word. send("aaaaaaaaaaaaaaaaaaaaaaaaaaa") sleep(1000) send("{tab}") sleep(300) send("bbbbbbbbbbbbbbbbbbbbbbbbb") sleep(1000) send("!a") sleep(300) then the result is "aaaaaaaaaaaaabbbb" and i dont know how to use ControlSetText with "find and replace" :| Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 25, 2014 Share Posted July 25, 2014 (edited) Using ControlSetText will prove to be much more reliable than using Send. The AutoIt Window Info Tool can be used to obtain the Control ID and other information that you will need to use that function. Edited July 25, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
jdelaney Posted July 25, 2014 Share Posted July 25, 2014 This may or may not work on your version. I'm unable to get the buttons. Probably need UI automation for that, but most is done: ; initate the find-replace window...then execute this script $hFindReplace = WinWait("Find and Replace") WinActivate($hFindReplace) $hFind = ControlGetHandle($hFindReplace,"",1024) $hReplace = ControlGetHandle($hFindReplace,"",1026) ControlSetText($hFindReplace, "", $hFind, "searchstring") ControlSetText($hFindReplace, "", $hReplace, "replacestring") ControlSend($hFindReplace, "", "","!a") WinWaitClose($hFindReplace) ConsoleWrite("done" & @CRLF) langthang084 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Muzaiyan Posted July 25, 2014 Share Posted July 25, 2014 i think you was looking for this Opt('SendAttachMode', 1) ; 0 = Don't attach, 1 = Attach. Opt('SendCapslockMode', 0) ; 1 = Store and restore, 0 = Don't store/restore. Opt('SendKeyDelay', 5) ; ? = 5 milliseconds. Opt('SendKeyDownDelay', 1) ; ? = 1 millisecond. if you are still not satisfied then make a udf like this Func _Send($character,$sleep) Send($character) Sleep($sleep) EndFunc and send your string character by character using a loop langthang084 1 Link to comment Share on other sites More sharing options...
jdelaney Posted July 25, 2014 Share Posted July 25, 2014 Seems like putting makeup on a pig (just an opinion) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Muzaiyan Posted July 25, 2014 Share Posted July 25, 2014 i was replying to this is there anyway to use sleep(time) to make script stop until the send complete, then run the next send code 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