mortog 0 Posted July 22, 2011 hey folks, I'm trying to write a little program that keeps looping and checks if the active window contains the string 'Confirm' and if so will give a right arrow and enter key input, however what I've got so far isn't working. I'm probably completely overlooking something small here, but I have a bit of a blackout and was wondering if someone could tell me where I'm going wrong. Thanks in advance! HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc Sleep(2500) While 1 If WinActive (StringInStr(WinGetTitle("[Active]"), "Confirm" )) Then Send ("{Right}") Sleep(200) Send ("{Enter}") Else EndIf Sleep(2500) WEnd Share this post Link to post Share on other sites
ajag 10 Posted July 22, 2011 Do you mean this? HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc Sleep(2500) While 1 If StringInStr(WinGetTitle("[Active]"), "Confirm" ) Then Send ("{Right}") Sleep(2000) Send ("{Enter}") Else EndIf Sleep(2500) WEnd A-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Share this post Link to post Share on other sites
mortog 0 Posted July 22, 2011 I did indeed! Thanks a lot mate Share this post Link to post Share on other sites