Bringing Mail window to the front

I have what I'm sure is such a basic question that I'm almost afraid to ask but here goes. I simply want the Mail.App inbox to become the front window when I press the F1 key. I have tried the Activate mail action and Bring Windows with name "All Inboxes" to the front neither individually or both together work. Mail is active but minimized. When I press the F1 key Mail shows as there active application in the title bar but no windows are displayed. I've tried different function keys to see if maybe there was a conflict with F1 to no avail.

I would greatly appreciate any suggestions here.


Not basic at all -- minimised windows/hidden apps can be a pain sometimes...

But first:

You minimise windows, but hide apps. Are you actually hiding Mail or have you minimised the Viewer window then switched to another app?

Thank you for your assistance. I'm not sure I understand the distinction but what I do is I click on the yellow button, of the window that is showing my inboxes so I suspect that is "hiding the app" , however other mail windows for example if I am composing a message remain open. Does that help answer your question?

This first part may need slight adjustments for more recent versions of macOS.

In Mail, use the View menu to select Show Favorites Bar. If that's not available and instead Hide Favorites Bar is an option, than the Favorites Bar is already showing. Perfect.

Once/If the Favorites Bar is displayed, add the Inbox if it's not already included. You can do this by dragging the Inbox from the Mail sidebar to the Favorites Bar or (I think in newer versions of macOS) by right clicking on the Inbox and selecting Add To Favorites Bar.

Mail, by default counts the mailboxes in the Favorites Bar from left to right. The leftmost mailbox gets assigned Command-1, next Command-2, etc., all the way to Command-9. In my Favorites Bar, the Inbox is first, so Command-1.

Make a Keyboard Maestro macro in a Mail-only Macro Group like is shown below. It's using the Type A Keystroke action.


In my testing, this worked even if the Inbox was minimized (in the Dock), which is what happens when clicking the yellow button at the top right of a window.

Thank you for your assistance. I just tried it and if Mail is opened and the frontmost application then this works to take me to the inbox. However if Mail is minimized and I am in for example Safari pressing F1 does nothing.


I didn't realize you wanted this to work from any application. Easily adjusted.

First, move the Macro you created to the Global Macro Group. This will ensure the Macro works no matter what application is front most. Next, we'll adjust the Macro to account for other applications potentially being at the front. Here's the Macro:


First, the primary Action you want is If Then Else. Within it, you'll instruct it to look if Mail is already at the front. If so, simulate Command-1 (Type A Keystroke) to go to the Inbox.

Otherwise (aka, Else) Activate a Specific Application (Mail), then simulate Command-1 (Type A Keystroke) to go to the Inbox. I've included a Pause because that may be needed while waiting a moment for Mail to come to the front. If it's not necessary in your testing/usage, feel free to omit that Action.

Worked like a champ!!!!! I was getting a short screen flicker when it took the ELSE branch but shortened tot he pause to .1 and it went away. Now it works if 1) Mail is open but not the front window 2) minimized, 3) not running at all....

Truly appreciate the assistance here a good learning point for me.

If you want more precision -- for example, to unminimise the "All Inboxes" window when you have a second Viewer window open on a different mailbox -- you need to get a bit more complicated.

This will unminimise the "All Inboxes" window if it is minimised, bring it to the front if it is open but not frontmost, or make a new Viewer window for "All Inboxes" if one doesn't exist (so you don't lose your place in another mailbox).

In Sonoma, at least, ⌘1 is the default to open "All Inboxes" so there's no setup required (unless you've changed the defaults!).

Mail - All Inboxes.kmmacros (6.5 KB)


Thanks the original one you gave me for mail is working great... I am now trying to adapt it for Safari but the only way I can get it to work is to open a new tab each time I invoke the macro when what I would like is to just open Safari with the existing tabs and if there are no currently open tabs open the start page. The only was I can get it to work is to issue a "CMD T" instead of the "CMD 1" but that opens a new tab every time. Any suggestions here.

Thanks in advance,