Sikuli disappeared and did not return

Asked by felipe cavalcante

hi I have a big problem, today I spent the afternoon doing a script, when I do a test program disappeared and did not come back, now my script was with him. Already tried alt + shift + c several times and not worked.
please give me a hint.

Question information

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

I know from other questions, that you are using endless loop
while True

which will never come back, if no error occurs.

Since alt-shift-c does not work all the time, you have to kill the respective java process (Sikuli IDE) using the task manager in this case.

scripts should always be saved before running them. otherwise there might be the risk to lose the changes in case of kill.

An endless loop should always have some condition that ends it.

the easiest solution:
as a last action in the loop put
if not exists(some_image, 0): break

some_image should be an image that must be visible as long as the loop should continue.

Before running the script prepare an app (e.g. notepad) with a window, that hides this image, if it is frontmost.

So if you want to stop your loop, just use the task switcher (Windows: alt-tab), to get it to front and your loop will end latest the next time, the above statement will be processed (or it might crash earlier, if some other image is not found).

Using a keyboard action to do this is better, to not interfere the mouse usage of the script.

Revision history for this message
felipe cavalcante (felipel-2-0) said :
#2

thanks for the tip, I already used the task manager but not the Sikuli appeared.
 I think the process even died because he relied on several images. I'll be more careful now.
thanks for your help. will greatly help