← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #149392]: I would like to know if there is a way to pass in parameters for a sikuli script?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Sorry, but if you want to use more advanced features, you have to learn
how to use some needed Python features ;-)

So here you are, to motivate you a little bit:

--- running script from commandline with a parameter:

You should be in the directory containing your script.sikuli

PATH-TO-SIKULI/sikuli-ide.bat -r script.sikuli --args "yahoo.com"

--- inside your script:

switchApp("C:\Program Files\Internet Explorer\iexplore.exe")
find(image )
click(image )
type( 'http://' + sys.argv[0] )
click(image )

comment: I found that in the current version the given parameters are in
sys.argv[0] upwards

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