sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #04462
Re: [Question #167444]: How to make options and link different sikuli scripts together.
Question #167444 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/167444
Status: Open => Answered
RaiMan proposed the following answer:
--1. .exe and run on other computer (supposing we are talking about
windows)
On the client PC you need:
- sikuli-script.jar
- the contents of the libs directory
- path to the libs directory in system path
- path-to-java/jre6/bin in system path
- path to sikuli-script.jar in Java class path
This is possible to pack in an .exe, that contains an installer (look
for available software in the net).
If you are an experienced Java programmer, you might pack everything in
one jar and write an installer with Java.
To run a Sikuli script in such an environment:
java -jar path-to-some-dir/sikuli-script.jar path-to-some-dir/your-script.sikuli
--2. interactively select options for a script run
currently the only feature, that is available in Sikuli, is the input() function.
Should be enough if it is for you.
If you want a more comfortable frontend, you either have to switch to
Java programming or use some Software, that allows to design and handle
option dialogs and finally run your Sikuli script from command line
(options as parameters or read from a file).
If you have different scripts (or macros as you say), that should be run
depending on the selected options, just make a main script that gets the
options and dispatches the macro to run (which itself are packed in on
or more .sikuli, that can be imported or run using execfile())
example with input()
text = \
"headline\n" \
"=========\n" \
"subtext\n" \
"subtext\n" \
"subtext\n" \
"subtext\n" \
"subtext\n" \
"subtext\n" \
"subtext\n" \
"==================\n" \
"please enter a number"
num = None
while not num:
answer = input(text)
try:
num = int(answer)
except:
print "Error: not a number", answer
if not (num > 0 and num < 16):
print "Error: number not in range", answer
num = None
print "Selected:", num
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.