← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #205272]: Maximize the window - Mac

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
There is no  "importing os or any other module" available for
application control on Mac with Jython.

The easiest way, to manage zooming without searching  is to use the
following key sequence with the app focused:

# a function (german locale!)
def toggleZoom():
    type(Key.F2, KeyModifier.CTRL) # jump to menu bar
    type("f") # select Window menu
    type(Key.ENTER) # open
    type("z") # select Zoom
    type(Key.ENTER) # do it

# usage
toggleZoom()

You could add a short cut key to Systempreferences for all Programs (e.g. shift-cmd-m), so you could use:
type("m",KeyModifier.SHIFT+KeyModifier.CTRL)

Or you might use AppleScript via osascript via os.popen() to access the
app's windows and do with them, what SystemEvents allows with the Mac
GUI elements.

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