Jump to content

Recommended Posts

Posted (edited)

Hello,

When I viewed the helpfile of AutoIt, I found something interesting...the send function :graduated: ...

Then I tried to make it my own, so I made this script:

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("H")

Sleep(100)

Send("e")

Sleep(100)

Send("l")

Sleep(100)

Send("l")

Sleep(100)

Send("o")

Sleep(100)

Send(" ")

Sleep(100)

Send("w")

Sleep(100)

Send("a")

Sleep(100)

Send("z")

Sleep(100)

Send("z")

Sleep(100)

Send("u")

Sleep(100)

Send("p")

Sleep(100)

Send("?")

WinClose("Untitled - Notepad")

WinWaitActive("Notepad", "The text in the Untitled file has changed")

Send("!n")

Exit

When I doubleclick on the .au3-file it workes perfect, but when I compile it to an executable and I doubleclick on the executable, it runs itself again and again, until my computer crashes! After 5 seconds, the file has loaded itself 50 times or so.. :o

What did I do wrong in my second script? :D

Sorry if my English is worthless, I'm Dutch :)

Greetings B) ,

Andreas

Edited by AndreasVliegen
Posted

You can do all the sends at once

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("Hello wazzup?")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "The text in the Untitled file has changed")
Send("!n")
Exit


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

Posted

You can do all the sends at once

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("Hello wazzup?")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "The text in the Untitled file has changed")
Send("!n")
Exit
Yes, I know, but I want to make the program as if the letters were typed.. B)
Posted

Yes, I know, but I want to make the program as if the letters were typed.. B)

Add "Opt("SendKeyDelay", 200)" above the example I gave.


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

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
×
×
  • Create New...