ext-kadams
3 years agoNew Contributor
How to wait on Command prompt till specific wText appeared
Is there any way to wait on command line window till the specific text is appeared in wText of Command prompt.
I have used below mentioned code, but it is not working:
var timeoutMinutes = 5
var loopDelay = 5000
var loopCount = 0
var loopCountMax = timeoutMinutes * 60 * 1000 / loopDelay // Timeout 5 Minutes
while(name == "Closing Projects..." )
{
var window = Aliases.cmd.wndConsoleWindowClass2;
var txt = window.wText;
aqString.ListSeparator = "\r\n";
s = aqString.GetListItem(txt, loopCount)
Log.Message(s);
if(s == "Closing Projects...")
break
loopCount++
rowcount = aqString.GetListLength(txt);
Log.Message(rowcount)
Log.Message(loopCount)
}