Forum Discussion
jmcpeek
11 years agoContributor
If you're just trying to get around the default timeout, you can just add the waittime to your waitaliaschild call and set it to 0. That way it will check to see if it exists and immediately move on without a delay.
As for generically waiting for something to happen, I wrote a function that I call when I'm waiting on something:
if AliasObj.WaitAliasChild('dlgImport", 0).Exists then...
As for generically waiting for something to happen, I wrote a function that I call when I'm waiting on something:
function waitWhile(condition, msg, timeout)
'*************************
' given a condition, message, and timeout period,
' waits for the condition to be true or the timeout to lapse
'*************************
t = 0
do While eval(condition) and t <= timeout
delaytext = t & " of " & timeout & " seconds passed waiting for " & msg
delay 1000, delaytext
t = t + 1
loop
if t <= timeout then
waitWhile = true
else
waitWhile = false
end if
end function
So if I was waiting for the window you're waiting on, I'd call it like so:
if waitWhile("not AliasObj.WaitAliasChild('dlgImport", 0).Exists", "window to load", 30) then
'it loaded so do something
else
'it didn't load, there's a problem
end if