← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #185061]: How to run multiple .sikuli files?

 

Question #185061 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/185061

    Status: Open => Answered

RaiMan proposed the following answer:
--- make a command file
Windows: a .bat/.cmd where you use Sikuli-IDE.bat
Mac/linux: shell script using sikuli-ide.sh

according to: http://sikuli.org/docx/faq/010-command-line.html


--- make a main script, that executes the others
the above solution adds the startuptime of 3-5 seconds to every script's runtime.
If you do not want this, make a main script with the following content:

import os
dir = "path-to-folder-containing-your-scripts"
# Windows: use raw string r"some text" or double the \

# for each script to run
# repeat this block
script = "some-script" # without .sikuli
scrpy = os.path.join(dir, script+".sikuli", script+".py") # the Sikuli Jython script to run
setBundlePath(os.path.join(dir, script+".sikuli") # to locate the images
execfile(scrpy) # executes the script in this context

# or run the scripts using a loop
for script in ("script1", "script2", "script3"): # names without .sikuli
# add your script names to the above list as needed
    scrpy = os.path.join(dir, script+".sikuli", script+".py") # the Sikuli Jython script to run
    setBundlePath(os.path.join(dir, script+".sikuli") # to locate the images
    execfile(scrpy) # executes the script in this context

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.