← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #270930]: Set Size of Screen

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
this works with latest build 1.1.0: (tested on OS X 10.10.5)

# make sure the app is running
mail = App("Mail")
mail.focus()
until = time.time() + 10
while not mail.isRunning(): 
  if time.time() > until: break
  wait(1)
if not mail.isRunning(): 
  print "Mail did not start"
  exit(1)

# resize/move window using applescript
cmd = """
applescript
tell application "Mail" to set the bounds of the first window to {0, 23, 800, 600}
"""
runScript(cmd)

... the magic behind runscript(cmd):
http://sikulix-2014.readthedocs.org/en/latest/scripting.html#running-scripts-and-snippets-from-within-other-scripts-and-run-scripts-one-after-the-other towards end of chapter

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