← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #172755]: Can't access main menu of application under test (Mac)

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- running a Sikuli script from command line

On Mac: If you want to run a script (the IDE stays invisible):

In Terminal:
/Applications/Sikuli-IDE.app/sikuli-ide.sh -r /Users/terence.cooper/Documents/siku_1.sikuli

an alternative leaving the IDE totally out:
java -jar /Applications/Sikuli-IDE.app/Contents/Resources/Java/sikuli-script.jar /Users/terence.cooper/Documents/siku_1.sikuli

Uuups: just realized: the latest version reports an error at the end
"[error] Can't run this Sikuli script: ...", but the script is run
perfectly. So just ignore the message - I will report a bug.

If you want to hide the Terminal session automagically, put at the beginning of your script:
switchApp("Terminal")
type("h", KeyModifier.CMD)

--- using the App class feature

on Mac, this works:
# once at beginning of script
myApp = App("your-app") 
if not myApp.window(): # check: open already?
      myApp.open() # open it
      while not myApp.window(): wait(1) # wait for app window, to be ready
myApp.focus() # give focus to app, can be used later as needed

"your-app" has to be the string, that you could use for your app to open
it with the open -a Terminal command.

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