Sign in to follow this  
Followers 0
AndreasVliegen

Problem after compiling script

6 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



You named your script "notepad.exe" so its running itself, not the program Notepad.

Share this post


Link to post
Share on other sites

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


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

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)

Share this post


Link to post
Share on other sites

You named your script "notepad.exe" so its running itself, not the program Notepad.

Of course, why didn't I think of that? B)

Thank you very much,

Andreas

Share this post


Link to post
Share on other sites

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.


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

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