I have a script without a hotkey that waits for a window and then performs a series of steps. The problem I'm having is that I can't get it to reset and wait for the window again, so it only runs once. How can I get it to keep running so the steps will be executed whenever the window appears? I read that I could use #Persistent and a loop, tried both, no luck. Here's the script:
Code: Select all
#IfWinActive ahk_exe SDLTradosStudio.exe
#Persistent
Loop
{
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
}