run from command line

Asked by moncho on 2020-03-20

Hi,

I have a file with more than 1500 lines. If a i try to run from sikulix i don't have any trouble. But if i want to run from command line (Windows) i don't have any response and is not working.

For that reason i try to make a python script to try to open sikulix and then press ctrl+r. The problem there is that always show a message of error on line 399 column 26, even if i don't have anything there.

The script python describe below is this:

from pynput.keyboard import Key,Controller
import os
import time
os.startfile("C:\Proyecto_Bonos\sikulx-2.0.1.jar")
time.sleep(5)
print("comenzando a escribir")
keyboard = Controller()
keyboard.press(Key.ctrl)
keyboard.press("r")
keyboard.release(Key.ctrl)
keyboard.release("r")
print("done")

This code works only when the sikulix file is lower than 399 lines.

Regards

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-03-22
Last reply:
2020-03-30
RaiMan (raimund-hocke) said : #1

what SikuliX?

how do you try to run the script from commandline?

any chance to divide the script into smaller chunks?

About your special Python solution I cannot help you anyways.

moncho (cruzzat) said : #2

Hi,

The version is 2.0.1.
I follow this instructions for running from command line:

https://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html#command-line-options-intention-run-the-experimental-scriptrun-server

I wrote this:

sikulx-2.0.1.jar -r Proyecto_bono.sikuli

when i press enter nothing happen. My develop works only when open the IDE and press the execute bottom.

RaiMan (raimund-hocke) said : #3

it must be

java -jar <path-to>\sikulx-2.0.1.jar -r Proyecto_bono.sikuli

Can you help with this problem?

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

To post a message you must log in.