JuggaloZeke 0 Posted November 23, 2004 (edited) The Problem: Sometimes the sript I wrote can run astray. I'm trying to solve this by making it check to see if it is at the correct place before it executes again. [it's in a while statement.]Ok... I want an If Then statement that functions like this:If [window is not active] Then Do this Else Do this EndIfbut I can't figure out how to make that first expression... an expression. Edited November 23, 2004 by JuggaloZeke Share this post Link to post Share on other sites
JuggaloZeke 0 Posted November 23, 2004 Even something like If [WinWaitActive exp[b][/b]ression] Then Do This Else Do This EndIf Would work but I don't know how to get the WinWaitActive to work with If. Share this post Link to post Share on other sites
SumTingWong 1 Posted November 24, 2004 (edited) Even something like If [WinWaitActive exp[b][/b]ression] Then Do This Else Do This EndIfWould work but I don't know how to get the WinWaitActive to work with If.<{POST_SNAPBACK}>WinWaitActive returns 1 for success and 0 for failureTherefore:If WinWaitActive(....) = 1 Then ; do something with active window Else ; window not found EndIfCheck help file for more info on WinWaitActive. Edited November 24, 2004 by pacman Share this post Link to post Share on other sites
SlimShady 1 Posted November 24, 2004 If NOT WinActive("Title", "optional text. you can leave this out") Then ;Do this Else ;Do this EndIf Share this post Link to post Share on other sites
JuggaloZeke 0 Posted November 24, 2004 Thanks pacman, I totally forgot that returned a value like that. Share this post Link to post Share on other sites