Jump to content
Sign in to follow this  
Sharn

Send command problem

Recommended Posts

Sharn

I have created this simple script:

-------------------------------------------------

Run("C:\windows\Notepad.exe")

Send("{a down}")

Sleep(5000)

Send("{a up}")

Exit

-------------------------------------------------

But in the notepad screen appears only ONE "a" character also if modify the sleep directive.

Why?

Share this post


Link to post
Share on other sites
Dampe

Try this:

AutoItSetOption ("SendKeyDownDelay", 5000)

Run("C:\windows\Notepad.exe")

Send("a")
AutoItSetOption ("SendKeyDownDelay", 5)

Share this post


Link to post
Share on other sites
Aassdd

Ya but it's strange that it's not working.

Share this post


Link to post
Share on other sites
BigDod

I have created this simple script:

-------------------------------------------------

Run("C:\windows\Notepad.exe")

Send("{a down}")

Sleep(5000)

Send("{a up}")

Exit

-------------------------------------------------

But in the notepad screen appears only ONE "a" character also if modify the sleep directive.

Why?

After you Send("{a down}") you have told the script to Sleep(5000) so it only manages to send "a" once before it sleeps. Instead of using sleep lookup Opt("SendKeyDownDelay", 1) in the help file.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
Aassdd

Then... how can I use {* down/up}?

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  

×