How to stop running script when ALT+SHIFT+C is not possible? --- workaround

Asked by Yadong Yu

---- workaround ---------------- (thanks to post #2)
# add to main script
def StopScript(event):
Env.addHotkey(<<key>>,<<modifier>>, StopScript)
# use a suitable key/modifier combination

I'm running my script from command line, and i know that hotkey "ALT+SHIFT+C" can do that.
However, hotkey conflict makes this not work sometimes....
Is there any other reliable way to stop the current running script?

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said (last edit ):

Sorry, currently not.

You have to abort the running task with system means.

I will make the stop-hotkey configurable (see: )

Revision history for this message
Corentin Gauquier (cocowork) said (last edit ):

I think i alredy read a workaround for this :

Just from my memory, I'd say it is something like that :

import sys
def StopScript(event):

Env.addHotkey(Key, KEY_CTRL, StopScript)

I think it is somewhere on this launchpad, I'll edit this post if I can find it again.

EDIT : Well it was quick, here's the link to the question, the answer is this one : masuo (masuo-ohara) said on 2015-08-14

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

Thanks for the hint.
At least a workaround, but you need it in every main script you are using.

So some global configurable option might be useful. I have it on the list now.

Can you help with this problem?

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

To post a message you must log in.