Here's what I have, but in the end the MsgBox displays "" instead of the value that's supposed to be inserted into the Edit control (which also is still ""). I'm currently getting a warning that a local variable named 'If' isn't defined, which really throws me off.
Code: Select all
SetConsole(cCommand,vValue) {
bState = "" ; Reset our validator
ControlGet, ID, Hwnd,,Edit1, Child Window
ControlFocus,, ahk_id %ID%
While (WinExist("Child Window") && If (bState="")) {
ControlSetText,, %cCommand%%vValue%, ahk_id %ID%
ControlGetText, bState, ahk_id %ID%
}
MsgBox %bState%
}
I've tried this script with While (WinExist("Child Window") && bState="") { , but bState still is "" instead of the the value %cCommand%%vValue%.
And I've tried While,(WinExist("Child Window") && (bState<>"%cCommand%%vValue%")) { which never exits the While (bState doesn't get set).
Note:
For whatever reason, when I use Edit1, this particular Child Window that I'm dealing with will not accept an entry. It doesn't matter how long I set a Sleep cycle before implementing the command, the ClassNN property just doesn't work:
Code: Select all
Sleep, 10000
ControlSetText,Edit1, %cCommand%%vValue%, ahk_id %ID%
2) Is there an undocumented Validator switch for ControlSetText that will not continue until it can validate that the control's text was entered correctly?