And because I was a bit bored this Sunday morning :), here's a very bare-bones macro to create a dictionary filled with apps' minimum window sizes.
Download Macro(s): Record minimum window sizes by app.kmmacros (9.2 KB)
Download Macro(s): Record minimum window sizes by app.kmmacros (9.3 KB)
Macro screenshot
Macro notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System information
- macOS 14.7
- Keyboard Maestro v11.0.3
This works as I hoped it would, which is always surprising when it happens on the first try :).
The macro runs on app switch, then checks to see if the frontmost app has an entry in the WindowSizes
dictionary. If it doesn't, it saves the frontmost window's current size and location, tries to resize the window to 20x20, then records the actual window size. Finally, it restores the old window size and location and exits.
If the app already has an entry in the dictionary, the macro exits.
Here are some values from the dictionary it created during testing on my Mac:
WindowSizes
------------------------
Keyboard Maestro : 825,258
Messages : 660,320
Music MiniPlayer : 350,64
Quicken : 860,586
Safari : 574,247
Signal : 300,200
TextEdit : 100,42
Now, there are more caveats than functionality with this macro :). As @Nige_S noted, Finder can have different minimums depending on whether the sidebar is open or not. And some apps may have different minimums for different window types (a topic list versus topic details, for example). Changing an existing entry requires mucking about with deleting dictionary entries. I could go on.....
To really put this to use, it'd have to be a lot more robust, but it does work as a proof of concept.
-rob.