Observer running in the background, closing dialogs on popup
I'm trying to create a script that will close certain windows/dialogs on popup - it i important that it runs in the background and closes the popups asap.
If I understand correctly, I can use the onAppear with observe set to infinite and background set to true.
My problem here is that I'd like to build a library of images that the onAppear handler would act on, so:
a =image1, image2, image3, image4
def myHandler(event):
wait(cross)
print "it happened"
onAppear(a, myHandler)
observe(FOREVER, background = True)
1. Am I checking the library correctly?
2. How to make sure that the main script will not terminate/continue before the handler finishes closing the dialogs? For example:
while True:
freeze the main script
run the handler
resume the script
3. Currently my script finds the main script image faster than the image from the library, thus not allowing the handler to close the dialog. I am unable to create a region for the library "a", because they all appear in different spots on the screen.
Is there any way to create a specific region for each of the images or something like that?
Thats a lot of questions, hopefully someone can help me :)!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Simon K for more information if necessary.