.isRunning() no long working for SikulixIDE in 2.0.4

Asked by Chris Kosieracki on 2020-05-30

2.0.4-2020-03-14_08:01/Mac10.14.5/Java8(64)1.8.0_251-b08

I just upgraded from 1.1.4 and found that the test to see if the IDE is running no longer returns the correct result.
I ran this script in the IDE, and also from a bash file both with the IDE running and not running. The results are always the same.

apps = ['Sikulix','SikulixIDE']
for app in apps:
    sIDE = App(app)
    ideRunning = sIDE.isRunning()
    if ideRunning:
        print(app + ' is running')
    else:
        print(app + ' is not running')

OUTPUT:
Sikulix is running
SikulixIDE is not running

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-06-08
Last query:
2020-06-08
Last reply:
2020-06-08
RaiMan (raimund-hocke) said : #1

should first be a question

RaiMan (raimund-hocke) said : #2

Since the SikuliX IDE is a jar-file to be run with Java, currently you cannot use the App features, to act on SikuliX IDE.

... and I do not think, that this is needed.

Chris Kosieracki (cckozie) said : #3

Thanks for the clarification.

I reported it as a bug instead of a question because this did work in 1.1.4, and I saw it as a loss of functionality. I have used it extensively to allow my scripts to behave differently when running from the IDE than when running as part of a bash script. It's not a huge deal, but I'll need to find another way to provide the functionality and then modify a few dozen scripts.

Best RaiMan (raimund-hocke) said : #4

You should use a user parameter after the -- when running from commandline and check for its existence (parameter missing means running in IDE).

... but I put the idea on the list, to have a chance to simply check, whether a script is running from IDE or from commandline.

Chris Kosieracki (cckozie) said : #5

Thanks Raiman. That is a viable alternative that I have used before I discovered isRunning.