Minimize Mail Window

My goal is to launch Mail and minimize window that opens with Applescript


With your help, I got this working:


tell application "Mail"

launch

set miniaturized of every window to true

end tell


It's running perfectly on a 2019 iMac Catalina and an 09 iMac (High Sierra), but on a 2014 MacBook Pro, the script just opens mail and does not minimize window.

Thanks again

MacBook

Posted on Jan 30, 2020 10:37 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 30, 2020 1:33 PM

The issue is likely to be less about the machine and more about the specific OS/Mail.app version number.


The terminology for minimizing a window has changed over time - minimized, miniaturized, etc. and it's likely to be some conflict there.


Open Script Editor on the MacBook Pro and look at Mail.app's dictionary. Under the 'window' definition there should be some indication as to what property to set.


Adjust the script as needed, recompile and save it, and see what happens.

7 replies
Question marked as Top-ranking reply

Jan 30, 2020 1:33 PM in response to mrokloricred37

The issue is likely to be less about the machine and more about the specific OS/Mail.app version number.


The terminology for minimizing a window has changed over time - minimized, miniaturized, etc. and it's likely to be some conflict there.


Open Script Editor on the MacBook Pro and look at Mail.app's dictionary. Under the 'window' definition there should be some indication as to what property to set.


Adjust the script as needed, recompile and save it, and see what happens.

Jan 30, 2020 11:18 AM in response to mrokloricred37

Follow up

It seems if the mail window is open and the x (close window) is chosen, then mail is quit, this script will just open mail. No minimization

If the minimize button is chosen and mail is quit, the script will run and have the mail minimized.


In short, the mail seems to remember the last state it was in and will minimize or not depending on which (close, minimize) was chosen previously


FYI this script has the same issues on all macs, just figured it out by chance.


I would like a script to run that will open mail and minimize it regardless of previous state if possible.

Thanks

Jan 30, 2020 1:23 PM in response to Glenn Leblanc

As I said previously, I want an AppleScript that will launch Mail and minimize the Mail window that is opened when mail is launched regardless of the state that Mail was left in previously. So, if Mail is launched without a script and I do not minimize the Mail window manually and then quit Mail, I want the AppleScript to open mail and minimize the window that it opens.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Minimize Mail Window

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.