Resize Window but not the open/close dialog box

I have a simple macro to resize new Safari windows when I click on them to my preferred size and location. It is triggered by the condition “the focused window changes” for the app Safari.

Unfortunately if I want to save a pdf that Safari has opened, KM sees the open/save dialog box as a new Safari window and screws up the sizing of the dialog.

Is there a way for KM not to view an open/close dialog as a new window? I tried using if/then and saved the URL to a variable so that if a new window had the same URL as the prior one it would not resize but that didn’t work.

I can think of a few different ways to solve this issue:

• Use If Then Else to check for the presence of the Save button that appears during open/close dialogs, and only resize the window if it is not:

• Save PDFs to your default download folder without a dialog by clicking the download button that appears upon mousing over the bottom of a PDF displayed in Safari:

• Change the macro trigger to use a hotkey or status bar menu option rather than an automatic "Focused Window Changes" condition so you have more control over when the macro fires.

1 Like

Excellent thought about the save button!

I’ll see what I can workout with that!


James R Ehrler

Works great! Used exists rather than enabled cause I thought it would capture more cases (?) where the button is present.


1 Like

Just as a final note, since I was also having the front window focus changing also triggering a window move/resize on print dialogs and print status dialogs in safari, I realized that the export, print and print status all have “Cancel” buttons in them. Thus using a condition for the existence/enabling of the Cancel button worked for all situations I’ve run into.


James R. Ehrler