Help making a script section conditional
Posted: 29 Nov 2018, 22:08
Hello,
I have the following script:
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!
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
}
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!