← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #190146]: Is there a way to check for a particular pop-up in the background throughout the script

 

Question #190146 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/190146

    Status: Open => Answered

RaiMan proposed the following answer:
This is a general misunderstanding:

SearchRegion.OnAppear(errorimg.png , handler_to_solve_error)

This only tells the SearchRegion, to setup a handler connection that has
to be called, when during an observation in this region the errorimg.png
appears.

This needs to be done only once in your script. This only stores
information, but does nothing.

The observation as such has to be triggered by saying
SearchRegion.observe(time)

This continuously looks for errorimg.png in SearchRegion until time
elapses. If it appears before, the handler is called and processed and
if observation is not stopped in the handler, the observation continues.

But since the script is paused at the observe(), this is not helpful in
your case.

You need the asynchronous version (the observation is detached in a subprocess and your script continues):
SearchRegion.observe(FOREVER, background = True)

Be aware: If you are using the mouse and keyboard in the handler, this
might interfere with your main workflow, so keep it short.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.