Jump to content

Recommended Posts

Posted

hi !

I have my script which checks multiple things on my computer, it runs inside a 20 second loop. Now I need to be able to close a specific window "error occured" when it shows.

I do it like this:

While 1
    Sleep(1)
        If WinExists ("error occured") Then WinClose ("error occured")
Wend

This works fine, but how do I include this bit of code in my big script which is itself a loop? I can't wait for the main loop to execute in order to check on this bit.

I already use AdlibEnable for some other stuff, it gets checked every few seconds.

The above example must close the error window as soon as it shows.

Please help, I'm still relatively new to scripting : ))

carpe diem

Posted

If you are allready using adlib and do not want to use it here, you could simply make that a function and call it periodically through out the code.

Func WindowStatus()

If WinExists ("error occured") Then WinClose ("error occured")

EndFunc

Then just call this function from time to time.

I have seen a script for multiple adlib like executions, you can find it by searching multitasking I believe. Downside of adlib is it stops the execution of the script while running. The multitasking post I believe avoided this to some extent.

I like cookies?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...