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
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:
But this also doesn't work! I simply can't figure out what's wrong
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?
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!!!
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.
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 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?
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...