Is it possible to stop an observer without an event occuring?

Asked by Ryan

I'm looking to stop an observer when the event hasn't occurred by the end of the script (or after some predetermined step is complete). Depending on which project we are automation I'm looking to create several different observers to monitor the execution for certain pop-up conditions (such as the word ERROR in a status bar) that may or may not need to halt execution, and save a screen shot.

In reading the docs and questions posted here it looks like the event returned from an onAppear() observer is used to stop the observer, however there is a chance the event will not occur before the script completes. Currently the observers are staying open beyond execution time. I can include a stripped-down code snippet if necessary.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

the observe feature is completely revised with version 1.1.0 (but the docs are not yet uptodate)

At least this: Now all still running observes are automatically stopped at script end.

with versions before 1.1.0 you might have to add a stopObserver() for each still observing region before leaving the script.

Can you help with this problem?

Provide an answer of your own, or ask Ryan for more information if necessary.

To post a message you must log in.