App.open doesn't work with variable passed on command line

Asked by Danish Innis on 2019-12-13

I have a script that opens an app with parameters. When I run it from the ide with a fixed command, it works perfectly.

cmd = "c:/path_to_exe/myapp.exe -- --param1 param1 --param2 param2"
App.open(cmd)

If I try running my script with parameters passed on the command line, it doesn't open the application.

java -jar sikulix-2.0.1.jar -r man-1 --args "c:/path_to_exe/myapp.exe -- --param1 param1 --param2 param2"

import sys
cmd = sys.argv[1]
App.open(cmd)

What am I doing wrong? I've tried several combinations of quotes etc., and while the cmd variable prints out correctly, it does nothing, not even give an error.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-01-03
Last query:
2020-01-03
Last reply:
2019-12-22
Danish Innis (techie45) said : #1

I'm passing in the full path to the executable, btw.

RaiMan (raimund-hocke) said : #3

SikuliX version?

Danish Innis (techie45) said : #4

2.0.1

RaiMan (raimund-hocke) said : #5

ok, will check.

Best RaiMan (raimund-hocke) said : #6

a fix will be available in 2.0.2 and is available in 2.1.0 nightly already now.

Danish Innis (techie45) said : #7

Thank you so much, this solved my problem. Sorry for the late response.

Danish Innis (techie45) said : #8

Thanks RaiMan, that solved my question.