I'm confused what the text parameter does in WinWaitActive.
According to the documentation here https://www.autoitscript.com/autoit3/docs/intro/windowsbasic.htm, it gives the example of typing "This is some text." However, I don't see the text in the image. Is it trying to match Visible Text or Hidden Text? Or does it try to match the first EditText it finds?
The text
parameter is what AutoIt looks for in Visible Text. If you open the Window Info Tool and select a new Notepad window with "This is some text!" written in it, the Visible Text tab of the Window Info tool will show "This is some text!" You can use this to tell AutoIt to act/wait using WinWaitActive when a file of the given title with the specified text visible is selected.
So the command WinWaitActive("Untitled - Notepad")
would activate for both a blank "Untitled - Notepad" instance and one with the same title plus any text in it. Meanwhile, WinWaitActive("Untitled - Notepad", "This is some text!")
would only activate for an "Untitled - Notepad" instance with that specified text written in it.