Move/Resize Window Not Working

Hi all, I have a surprising (to me, anyway) problem. I have a macro which I use to 'clean up' after using Time Machine, since it doesn't believe in restoring my Finder window's size and location. The macro contains a single step, Move And Resize Front Window, to

  • SCREENVISIBLE(Main,Height)

Problem is, only the bottom right corner of the window changes. So, I tried splitting the step into two: one to move (top, left) to (0,0) and the other to Resize to Pixels:

  • SCREENVISIBLE(Main,Height)

But this also doesn't work! I simply can't figure out what's wrong :upside_down_face:

Looks OK. Better post the macro itself (see here for how) in case something else is going on.

Also, given recent updates -- what're your OS and KM versions?

Thanks Nige! Here are the macro details:

Maximise Front Window....kmmacros (3.6 KB)

Step 3 is the original single step; steps 1 and 2 are the ones I tried to replace it with. Disabling step 3 makes no difference to the result.

And, this gets weirder. I've just realised that I have another macro, in my Word group, which manages to move windows across the screen!

New Window.kmmacros (7.8 KB)

I'm running KM 10.0.2 on Monterey 12.6.

Well, the good(?) news is that it works fine for me under macOS 12.6 and KM v10.2 whether I disable the first and second actions and just use your original or disable the third and use your replacement version.

If you add the following "Display..." action to the end and run the macro, what's returned?

frameDialog.kmactions (1.2 KB)

Here's the dialog:

BTW, I'm running on a MacBook Pro purchased late last year. Also, I just tried running the macro NOT after getting out the Time Machine interface (manually shrinking the window first), and I got the same results.

Edit: and I just realised that I use this macro every day with the Podcasts application, and it works flawlessly there!!! :upside_down_face:

Doesn’t work how? Does the move fail or the resize fail?

Post the actual actions used, and specify what you expect to happen, and what does and does not happen.

Hi Peter,

For clarity I'm going to put two versions of the same macro below. Note that neither of them produces the desired effect, which is that a Finder window which is smaller than the screen at trigger time ends up taking up the entire screen. In both cases the window's (bottom, right) corner ends up at the (bottom, right) corner of the screen, but the window's (top, left) corner stays exactly where it was at trigger time.

First macro, the original version:
Maximise Front Window... copy.kmmacros (2.0 KB)

Second macro, the version which does a move and then a resize:
Maximise Front Window....kmmacros (2.8 KB)

As noted earlier today, the original version works perfectly in Podcasts. The window ends up taking up the entire screen. I only tend to use the macro in the Finder and Podcasts, so I don't know how it performs in other apps.

The macros are both in my Global group.

Thank you for taking a look at this.

The accessibility API will only move/resize windows on the screen, so my guess is that it is deciding the top left corner is off the screen, try adding a couple to the top left corner, or for the bottom version, try starting at say 40,40 and see if that works, and then adjust from there.

So SCREENVISIBLE is returning expected values and everything else implies that this is only a problem with Finder windows, so we can assume KM's calculations and window moving is working everywhere except in the Finder.

Check your KM Engine log after running the macro with Finder frontmost. It might be that you've got a Finder-specific macro triggered by "window frame change" -- your macro is working, but the second one is instantly resizing the window to something else. You'll spot that second trigger event in the log.

Or it could be that you've a Finder-specific window management utility that, again, is overturning the positioning done by your macro. What happens if you click-drag the top-left corner of the window to the top-left corner of the screen -- does it stick?

Thanks Peter and Nige for your replies.

I'm working with the two-step version, and have added a very brief pause (.05s) between the steps, since this seems to be necessary (without it, (top, left) moves as desired, but (bottom, right) stays where it was). By using magic numbers for (top, left) of (25, 0) I can get the desired result. I'd prefer to not have to use them, but it seems that SCREENVISIBLE(Main,Left) and SCREENVISIBLE(Main,Top) are just not going to work here.

Note that these numbers do not reliably work in the one-step version. Something very weird is going on, since I can get them to work if I start with a larger value for left, e.g. 20 and then successively smaller values down to 0. But, whatever.

Nige, I couldn't find out how to view the engine log, but certainly, manually dragging the window (top, left) does not get undone -- the corner stays where I put it. That's what I've been doing when the macro doesn't work. And, there is nothing in my Finder macro group that changes window position/size, and it's the only macro group apart from Global which is available in the Finder.

Going back to the initial problem, I tried Enter Time Machine with my Finder window in various locations. In the Time Machine interface, I hit Cancel or Restore on different tries. Every time the Finder window returned to its initial size and location. Is that not working for you?
macOS 12.6 Apple Studio Display

Wow, that's amazing. I have never had Time Machnie clean up after itself! My partner has the same gripe. I have a laptop and he has a big-screen desktop. My Finder always has a single window, size = screen size, with multiple tabs. After TM it's the same size as it is in the TM interface, that stupid little thing in the middle of the screen. Totally annoying.

OK, so I can duplicate what you're seeing.
If I set my Finder window to the full screen size (27" Studio Display minus Dock), enter Time Machine, then exit, my Finder window is no longer full screen size, but the size shown in the Time Machine interface. That's still huge on my display, easily 4 or 5 times my usual Finder window size.
I don't have a MacBook to test on.

Darn, that gave me hope that by having the window size be just a little less than full screen I could have Time Machine actually clean up after itself. Alas, it was not to be. Depending on where the window is and what size it is prior to Enter Time Machine, the Finder at times remembers the position, but it never remembers the size. My partner also finds that while he has multiple windows open before Enter Time Machine, only a single window remains afterwards.

Totally weird that your machine actually restores window size/position...