Tinkerz Posted May 27, 2013 Posted May 27, 2013 _WinWaitActivate("Message","") Send("{ENTER}") Sleep(5000) _WinWaitActivate("Control Center - AAA1Turo1Intraday","") Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If WinActive($title,$text)==0 Then WinActivate($title,$text) Else {more commands} End if WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() _WinWaitActivate("Message","") _WinWaitActivate("Control Center - AAA1Turo1Intraday","") I am using the autorecorder to start as the basis of my scripts, thats why the _ appears. What does the handle return if its not a "message"or "Control Center - AAA1Turo1Intraday", so I can run an if statement on another set of keystrokes if this does not appear This realtes _WinWaitActivate code, I want to write and if statement, if the handle is 0 for correct then I use == as the qualifer? Thanks again Tinkerz
somdcomputerguy Posted May 27, 2013 Posted May 27, 2013 Two equal signs (==) are used as a case sensitive check of two strings. See here - http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted May 27, 2013 Posted May 27, 2013 _WinWaitActivate() returns nothing either way. it will equate to 0 I think. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Tinkerz Posted May 27, 2013 Author Posted May 27, 2013 So how do I check if the screen that opens is or is not Control Center - AAA1Turo1Intraday ? So I wrap it in an if statement, a msgbox check I wrote does return 0, but what if the active window is not ("Control Center - AAA1Turo1Intraday","") Thanks
somdcomputerguy Posted May 27, 2013 Posted May 27, 2013 See http://www.autoitscript.com/autoit3/docs/functions/WinActive.htm This link may help too - http://www.autoitscript.com/autoit3/docs/ - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted May 27, 2013 Posted May 27, 2013 So how do I check if the screen that opens is or is not Control Center - AAA1Turo1Intraday ? So I wrap it in an if statement, a msgbox check I wrote does return 0, but what if the active window is not ("Control Center - AAA1Turo1Intraday","") Thanks You will need to manually add return values, or @error. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Tinkerz Posted May 27, 2013 Author Posted May 27, 2013 Ok thanks for the replys but this is not quite what I am trying to get to. If there is a message box to activate then activate the message box and press enter, _WinWaitActivate("Message","") But if a message box does not pop up then dont press enter but continue the code
JohnOne Posted May 27, 2013 Posted May 27, 2013 Add a timeout to WinWaitActive() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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