Zoom/Unzoom a window

I want to be able to switch the zoom the front window. Along with Minimize and Unminimize, Zoom is a choice in the Manipulate a Window action. I don’t want to toggle, I want to specify the state I want the window to be in – “maximum” or “regular”. The problem with the OS-X Zoom menu item and the KM Zoom action is that there is no indication on it of which state the window is in.

Can someone provide a way to implement this controlled zoom? The best I can think of is to check whether the window occupies the full height of the screen, but windows can occupy the full height (or width, for that matter) of the screen without being fully zoomed. (Width is even less of an indicator because often zooming a window out does not use the entire screen width.)

You may not need KM for this. Most apps support Zoom as follows:

  • 0 – 100%
  • + – Zoom IN (larger)
  • - – Zoom OUT (smaller)

I want Zoom the way OS-X defines it: zoom to maximum size, zoom back to previous size.

Hey Mitchell,

This is ambiguous.

Keyboard Maestro 7.0.4d5 is saying Zoom but doing Enter Full Screen on my system.

Do you want to zoom any given window to the maximum possible size on the screen?

OR

Do you want to Enter Full Screen – e.g. create a new Space with that window?

The actual menu item for Zoom does NOT ubiquitously maximize the window – it toggles the window between the last two proportions it was resized to. (If memory serves -Clicking the Zoom button used to “Maximize” the window in most apps, but El Capitan has ruined that little feature.)

There are ways to manage zoom or enter full screen, but you need to be crystal clear about what you’re trying to achieve.

-Chris

Well, I am still (purposely) behind in OS X, using 10.8 (and so using KM 6). The classic behavior of the first use of the Zoom menu command for a window is, of course, to maximize the dimensions of the window within logical constraints (that differ from application to application). A second Zoom returns the window dimensions to what they were before the first Zoom. That is the behavior I am trying to produce. Full Screen is an entirely separate matter, though one suffering from the same problems. (I haven’t checked whether there is a KM or AppleScript way to

The problem is that I don’t know of any way to find out the zoom state of a window. If the ancient Zoom behavior has changed in subsequent versions of OS-X – and one of the reasons I haven’t moved off 10.8 is that I don’t want to deal with changes like this – then I guess my question is ultimately meaningless. I suppose comparing window dimensions to screen size is all I can do (in 10.8).

Being that far behind in OSX is going to make it hard to get help here, since almost all of the active posters are either on Yosemite (10.10) or El Capitan (10.11)

Lots of good things for also changed from KM6 to KM7.

So, IMO, the sooner you can get to at least Yosemite and KM7 the better of you will be. I’m sure you have your reasons for being on the versions you are on. I’m just letting you know what to expect.

Good luck to ya.

Thanks for the advice. Looks like I have an Xcode project coming up. That, the point you make, and the growing number of upgrades of my favorite applications and utilities that require 10.10+ (or whatever) are making it necessary for me to finally give in.

My main reason for not upgrading has been my impression that OS-X is moving further and further towards an iOS-style user experience. I have used Macs literally from the beginning. (My first was a 128K 1984 model.) I am a developer and power user, not a consumer!

I also had that impression prior to upgrading to Yosemite. And it is somewhat true, but not as much as some of the tech blogs would have you believe.

IAC, there are settings you can make in System Preferences (and otherwise) to mitigate many of the Apple imposed styles, like transparency. Just do some searches on keywords like “upgrade mavericks yosemite” you should see a number of articles that help.

Since I upgraded from Mavericks to Yosemite about a year ago, I have NO regrets. And I hate the iOS UI style.

You might also be interested in this thread I started here just before my upgrade to Yosemite:

Zoom/Unzoom in the traditional sense. Not full screen. Apparently KM7 (I’m on 6) is inconsistent, calling “full screen” “zoom”.

Zoom on the Windows menu toggles between two states:

  1. the dimensions you have described by dragging
  2. maximum size, which, I think, is the full height of the screen up to the menu bar (not the same as “full screen”) and in almost all applications, the full width of the screen, but is sometimes a more natural width

“Full Screen” on the View menu is something else entirely. So is the Zoom on the Windows menu.

I can easily assign a keystroke to the Window menu’s Zoom item, but that leaves me with a toggle, whereas I want to specify which zoom I want – (1) or (2).

I consider the Window menu Zoom to be a UI mistake in two ways:

  • It duplicates a name used on the View menu of many (all?) applications.
  • It doesn’t show by the presence or absence of a checkmark which state the window is in, the way most toggles in most applications do.

The “Zoom” action Keyboard Maestro uses is the same “Zoom” accessibility API that has existed since OS X 10.0. Unfortunately, Apple changed the underlying behaviour to do Full Screen instead of Zoom, and did not provide any new accessibility API that I am aware of to do the old zoom.

So for the time being I am awaiting Apple coming to their senses.

Hey Mitchell,

With inconsistencies in different apps and in OSX itself this is not really feasible to do with Zoom.

You can play with this AppleScript to see where inconsistencies come into play.

tell application "System Events"
  tell (first process whose frontmost is true)
    tell (first window whose subrole is "AXStandardWindow")
      tell (first button whose subrole is "AXFullScreenButton")
        try
          perform action "AXZoomWindow"
        end try
      end tell
    end tell
  end tell
end tell

You can use the Manipulate a Window action to resize a window to full-screen.

You can use the same action to custom resize a window.

If you want to be able to restore the window’s original state you can SAVE it and restore it later.

Personally I use MercuryMover (a window manager) and a bunch of AppleScripts to resize windows on my system.

-Chris