Passing arguments from cmd to a sikulix script

Asked by Henrique on 2019-04-08

So I'm trying to test a script where I should be able to pass any arguments written in the command line. I'm able to print the arguments hardcoded into the batch file. How can I make the command line wait for an argument and then print it using the script?

batch file ------------------------

java -jar "PATH\teste_sikuli.jar" "PATH\teste.sikuli" --args "arg1 arg2 arg3"
pause

script -----------------------------

import sys.argv
print sys.argv[1]
print sys.argv[2]
print sys.argv[3]

cmd output ------------------------

PATH\teste.sikuli
--args
arg1 arg2 arg3

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-04-08
Last reply:
2019-04-08
RaiMan (raimund-hocke) said : #1

In this case the commandline is not scanned by SiluliX.
You have to do it on your own in your main

Can you help with this problem?

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

To post a message you must log in.