Jump to content

If then else statement on _WinWaitActivate


Recommended Posts

_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

Link to comment
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

Link to comment
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.

Link to comment
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




			
		
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...