Zoar 0 Posted July 21, 2010 Hi, Very new to this so sorry if this is a little stupid. Just starting a script to open my web browser and am using “winwaitactive” with a timeout value which I understand. However how do I capture the “Return Value” which according to the help is “0” if the timeout fails, so I can redirect the script? WinWaitActive ( "title" [, "text" [, timeout]] ) Parameters title The title of the window to check. See Title special definition. text [optional] The text of the window to check. timeout [optional] Timeout in seconds Return Value Success: Returns handle to the requested window. Failure: Returns 0 if timeout occurred. Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 21, 2010 $returnvalue = WinWaitActive ( "title", "text", 5) $returnvalue now holds the return value from WinWaitActive If the window does not become active within 5 seconds the value will be 0 Else it will be a handle to that window. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Zoar 0 Posted July 21, 2010 Ah so simple, like me! Thanks for the very quick reply Share this post Link to post Share on other sites
adik2dmax666 0 Posted July 21, 2010 or.. Global $Filler = WinExists("Google - Mozilla Firefox", "") If $Filler = 1 Then MsgBox(0,"Testing","Firefox exists, return value: " & $Filler) Elseif $Filler = 0 Then MsgBox(0,"Testing","Firefox inexistent, return value: " & $Filler) EndIf First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub] Share this post Link to post Share on other sites