Help making a script section conditional

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ndiaz
Posts: 73
Joined: 10 Jan 2017, 17:05
Contact:

Help making a script section conditional

29 Nov 2018, 22:08

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!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 132 guests