Devanos Posted November 23, 2007 Share Posted November 23, 2007 (edited) I cant get this to work please help me. am trying to get to work in a loop. what i want to do is wheni run the script. I would like it to do the folowing wait untill notepad is open,and when notepad is open i want it to send these numbers 1,2,3,4,5 and soo on and when it has reached a specific number i want it to startover from the first send command. is that possible or am i asking to much. i cant realy figure out how to create a loop of this. i have tried while/WEnd but i dont know how to set it up. i only get errors all the time. WinWaitActive("Untitled - Notepad") Send("{1}") Send("{2}") WinWaitClose("Untitled - Notepad") any help and i will be very greatful! Edited November 23, 2007 by Devanos Link to comment Share on other sites More sharing options...
Monamo Posted November 23, 2007 Share Posted November 23, 2007 I cant get this to work please help me. am trying to get to work in a loop. what i want to do is wheni run the script. I would like it to do the folowing wait untill notepad is open,and when notepad is open i want it to send these numbers 1,2,3,4,5 and soo on and when it has reached a specific number i want it to startover from the first send command. is that possible or am i asking to much. i cant realy figure out how to create a loop of this. i have tried while/WEnd but i dont know how to set it up. i only get errors all the time. WinWaitActive("Untitled - Notepad") Send("{1}") Send("{2}") WinWaitClose("Untitled - Notepad") any help and i will be very greatful! Here's a quick example (Escape key to exit loop): CODE HotKeySet("{ESC}","ExitIt") $threshhold = 15 While 1 $count = 0 Do $count += 1 ConsoleWrite($count &@LF) Until $count = $threshhold WEnd Func ExitIt() Exit EndFunc - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
Valuater Posted November 23, 2007 Share Posted November 23, 2007 Another expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused, $Runner HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") ;;;; Body of program would go here ;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() $Runner = Not $Runner While $Runner Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("{1}") Send("{2}") Sleep(5000) WinClose("Untitled - Notepad") Sleep(500) Send("{TAB}") Send("{ENTER}") WEnd EndFunc ;==>ShowMe 8) Link to comment Share on other sites More sharing options...
Devanos Posted November 23, 2007 Author Share Posted November 23, 2007 Thank you booth of you.that seams to do the trick. il try experimenting with these codes now and see what i can come up with. thanx booth very much! Link to comment Share on other sites More sharing options...
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