How to run multiple Sikuli scripts in a row using a Batch file

Asked by Benjamin Bruffey

I am attempting to run 6+ scripts in a row using a batch file. Each script is approximately 580 lines long. Each scripts, individually, runs perfectly fine, but when I attempt to run them with a batch file, only one runs. So i've attempted to make a sikuli script that runs each of them by importing them., this main script is started with a batch file. I have only had success with the first 2 running then it stops at the end of the second script. Any ideas of what could possibly be going wrong?

This is my batch file:

@ECHO OFF
REM Runs both my project scripts

D:\sikuli\runIDE.cmd -r path_to_my.sikuli
ECHO Ran project 1
D:\sikuli\runIDE.cmd -r path_to_my.sikuli
ECHO Ran project 2

I don't have any more scripts set to run in this batch file as it only runs the first then quits.

Thanks

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

try this:

start /i /b /wait D:\sikuli\runIDE.cmd -r path_to_my.sikuli
ECHO Ran project 1
start /i /b /wait D:\sikuli\runIDE.cmd -r path_to_my.sikuli
ECHO Ran project 2

Revision history for this message
Benjamin Bruffey (bruffster) said :
#2

Thanks RaiMan, that solved my question.

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

Woooow, did that really do it?
I did not test it ;-)

Revision history for this message
Keyur (keyurh) said :
#4

I was looking for exactly this.
Thanks !

Revision history for this message
Keyur (keyurh) said :
#5

When I try it with the following command on Windows.

START /i /b /WAIT %SIKULI_IDE_PATH% -r %PATH_TO_.SIKULI%

I get the following error

Windows cannot find '-r'. Make sure you typed the name correctly, and then try again.

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

This error message only makes sense, if at time of executing this command the
%SIKULI_IDE_PATH%

is empty

How are you using thus command?

Revision history for this message
Keyur (keyurh) said :
#7

Running %SIKULI_IDE_PATH% -r %PATH_TO_.SIKULI% works perfectly. It only gives that error when prepended with START /i /b /WAIT

However, on investigating some more, as indicated on the thread here: https://answers.launchpad.net/sikuli/+question/237460 I was able to use this format as a workaround without any problems:
@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram1.sikuli

Thanks again for the quick response.

Revision history for this message
Sudhir Verma (asksudhirverma) said :
#8

Hi ,

I am able to execute the multiple sikuli scripts as a batch file which is below

@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram1.sikuli
 @CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram2.sikuli

But I want to execute all the sikuli files which is existed in the folder in geraralised format. In the above example every time used the path of the sikuli file. I want to read the folder and execute all the sikuli which is existed in the folder.

Please guide me.

Thanks in advance

Revision history for this message
Sudhir Verma (asksudhirverma) said :
#9

Hi ,

I am able to execute the multiple sikuli scripts as a batch file which is below

@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram1.sikuli
 @CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram2.sikuli

But I want to execute all the sikuli files which is existed in the folder in geraralised format. In the above example every time used the path of the sikuli file. I want to read the folder and execute all the sikuli which is existed in the folder.

Please guide me.

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

@Sudir

please start your own question, so everyone sees it