← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #148254]: Getting path of .sikuli script running

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- in the IDE:

when running a .sikuli script, the path to the script is accessible with
getBundlePath().

For a .skl, since this is unzipped as .sikuli to a temp folder, this
will be the temp folder location and not the path to the .skl

--- running from command line:

when running a .sikuli from command line using sikuli-script.jar, you
can use os.getcwd() and join it with sys.argv[0], which contains the
path to the script as given on the command line (relative or absolute).

a .skl can only be run from command line using sikuli-ide.jar (this
contains the unzip feature). In this case, getBundlePath points to the
temp folder, but os.getcwd() returns the path to the current directory
and sys.argv[0] contains the path information of the .skl as given on
the command line.

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