If image not found, set clipboard to "img not found"

Asked by eduardobedoya

Hi,
Currently Im using...
reg.click(Image) (if image doesn't appear within default wait time stop script)
and
reg.wait(Image, 9) (if image doesn't appear within 9 seconds stop script)
I remember the default wait was about 3 seconds

How can I tell sikuli that
if image doesn't appear set clipboard as "image not found" and only then stop script, (it's necessary to stop script after clipboard change)

I have used...

try:
    reg.click(Image)
except
    App.setClipboard("image not found")

which is the best way to achieve this? thanks advanced.

Question information

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

try:
    reg.click(Image)
except
    App.setClipboard("image not found")
    exit()

Revision history for this message
eduardobedoya (gonnabdh) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
RaiMan (raimund-hocke) said :
#5

Uuuups ????????????

your comments vanished very fast ;-)