AndreasVliegen Posted November 6, 2005 Posted November 6, 2005 (edited) Hello, When I viewed the helpfile of AutoIt, I found something interesting...the send function ... 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.. What did I do wrong in my second script? Sorry if my English is worthless, I'm Dutch Greetings , Andreas Edited November 6, 2005 by AndreasVliegen
Valik Posted November 6, 2005 Posted November 6, 2005 You named your script "notepad.exe" so its running itself, not the program Notepad.
BigDod Posted November 6, 2005 Posted November 6, 2005 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
AndreasVliegen Posted November 6, 2005 Author Posted November 6, 2005 You can do all the sends at onceRun("notepad.exe") WinWaitActive("Untitled - Notepad") Send("Hello wazzup?") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "The text in the Untitled file has changed") Send("!n") ExitYes, I know, but I want to make the program as if the letters were typed..
AndreasVliegen Posted November 6, 2005 Author Posted November 6, 2005 You named your script "notepad.exe" so its running itself, not the program Notepad.Of course, why didn't I think of that? Thank you very much,Andreas
BigDod Posted November 6, 2005 Posted November 6, 2005 Yes, I know, but I want to make the program as if the letters were typed.. 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
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