Jump to content

send problem on slow computer


Recommended Posts

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

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

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

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)
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

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 :):D:P

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...