Sign in to follow this  
Followers 0
Tinkerz

If then else statement on _WinWaitActivate

8 posts in this topic

_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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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




			
		

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0