kforsey Posted February 25, 2005 Posted February 25, 2005 (edited) I got a question, How do you make a loop go from start to finish of a script for X amount of times. Like say I was using the script Sleep(1000) Send("Hello") Send("{ENTER}") Sleep(1000) Send("Goodbye") Send("{ENTER}") And I wanted it to keep repeating this over and over agin into Notepad for X amount of times. I've been reading the help and can't figure out how to loop. Please help any help would be appreciated. Thanks Edited February 25, 2005 by kforsey
buzz44 Posted February 25, 2005 Posted February 25, 2005 (edited) Run("NotePad.exe") WinWait ("Untitled -") $i = 0 Do $i = $i + 1 Sleep(1000) Send("Hello") Send("{ENTER}") Sleep(1000) Send("Goodbye") Send("{ENTER}") Until $i = 10 where 10 = X (the amount of times u want it to repeat) =) Edited February 25, 2005 by burrup qq
buzz44 Posted February 25, 2005 Posted February 25, 2005 another way =) Run("NotePad.exe") WinWait ("Untitled -") $i = 0 While $i < 10 $i = $i + 1 Sleep(1000) Send("Hello") Send("{ENTER}") Sleep(1000) Send("Goodbye") Send("{ENTER}") Wend qq
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