Page 1 of 1

Help making a script section conditional

Posted: 29 Nov 2018, 22:08
by ndiaz
Hello,

I have the following script:

Code: Select all

Loop
{
WinWait,Add Supported Language Pairs
Send {Esc 2} 
WinWait,Information
WinGetText, text
Send {Esc}
RegExMatch(text,"(?<=').*(?=')",TMname)
;Sleep 100
Send !u
;Sleep 100
Send {Down 6}{Enter}
;Sleep 100
Send %TMname%
;Sleep 100
Send {Enter}
;Sleep 100
WinWait,Add Supported Language Pairs
WinClose 
}
The window called "Add Supported Language Pairs" doesn't always appear. How can I make the action to close it conditional upon it appearing, and still have the rest of the script run regardless of whether that window appears or not? In other words, I'd like to do the following:

1. If "Add Supported Language Pairs" appears, close it (it usually appears twice, consecutively and both need to be closed, hence the "Esc 2" above)
2. If "Add Supported Language Pairs" doesn't appear, still proceed with the rest of the script

Thank you in advance for your help!

Re: Help making a script section conditional

Posted: 30 Nov 2018, 00:19
by AlphaBravo