← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #209937]: Sikuli disappeared and did not return

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
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.

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