WaitUntilEnabled
bool WaitUntilEnabled(string ctrl, int timeoutMs)Description
Waits until the specified UI control becomes enabled (interactive).
Polls every 100 ms until the control is enabled or the timeout expires.
Returns true if the control became enabled within the timeout, false otherwise.
This is useful after loading operations or async processing where controls are initially disabled.
Parameters
- ctrl - Identifier of the UI control to monitor.
- timeoutMs - Maximum time to wait in milliseconds.
Returns
true if the control became enabled within the timeout, false if the timeout expired.
Example
void main()
{
bool ready = WaitUntilEnabled("BTN_SUBMIT", 10000); // Wait up to 10 seconds
if (ready)
{
LeftMouseClick("BTN_SUBMIT");
}
}