JAVA icon on MAC/PC when running from TERMINAL

Asked by Steen

When running the Sikuli scripts from Terminal on MAC, you get a JAVA Icon you can quit if when testing!

is the same possible on PC?

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

This is weird on Windows:

The running Java process does not produce any icons, that can be used to stop a running script.

Using the IDE, you can try the abort key shift-alt-c, but you might have to try it more than once.

This abort key does not seem to work with using Sikuli-IDE.bat or Sikuli-IDE-w.bat running a script from command line.

At least with Sikuli-IDE.bat you have a chance by sending a ctrl-c to the command line window, which lets you abort the running batch command. Or just close the command line window.

In all cases the running process is not accessible by icon or window, you have to use the taskmgr.exe to kill it.

--- As a workaround you might implement your own hotkey (at beginning of script):
def myAbort(e): exit()
Env.addHotkey("x", KeyModifier.CTRL+KeyModifier.ALT)

But be aware: Since the above exit() is processed in an independent subprocess, it might kill your script during some mouse or keyboard action and leave your GUI in a weird situation. So take care.

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

Sorry, too fast ;-)

Env.addHotkey("x", KeyModifier.CTRL+KeyModifier.ALT, myAbort)

Revision history for this message
Steen (steenc) said :
#3

Thanks RaiMan, that solved my question.