You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Miniaturize Mail won

I have this script:


tell application "Mail"

launch

set miniaturized of every window to true

end tell


This launches mail and miniaturizes window in the dock.


I want to save this script and create another one:


tell application "Mail" to launch


I want to do away with the miniaturization, yet the script from the line above still miniaturizes despite no language to do so.


Any help?


Running high Sierra on this older mac


Thank you

iMac Line (2012 and Later)

Posted on Jun 2, 2020 11:34 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 2, 2020 5:42 PM

It isn't entirely clear what your current state is, but maybe I can shed some light.


When Mail.app launches, it should restore windows to their previous state (as of when it was last quit).

Therefore if Mail.app was previously minimized when you last quit, it will reopen in that state, regardless of whether you explicitly ask it to or not.

On that basis, is it possible it was miniaturized when you last quit it? That could explain what you're seeing.


Secondly, there is a difference between telling an application to 'launch' vs. 'activate'.

Both commands will open the app, but 'launch' will leave the app in the background, whereas 'activate' would bring it frontmost.

Is is possible that the app is opening in the background (i.e. 'launch'ed) and you're assuming it's open miniaturized? If so, change the second script to 'activate' rather than 'launch' the app to make it frontmost.

2 replies
Question marked as Top-ranking reply

Jun 2, 2020 5:42 PM in response to mrokloricred37

It isn't entirely clear what your current state is, but maybe I can shed some light.


When Mail.app launches, it should restore windows to their previous state (as of when it was last quit).

Therefore if Mail.app was previously minimized when you last quit, it will reopen in that state, regardless of whether you explicitly ask it to or not.

On that basis, is it possible it was miniaturized when you last quit it? That could explain what you're seeing.


Secondly, there is a difference between telling an application to 'launch' vs. 'activate'.

Both commands will open the app, but 'launch' will leave the app in the background, whereas 'activate' would bring it frontmost.

Is is possible that the app is opening in the background (i.e. 'launch'ed) and you're assuming it's open miniaturized? If so, change the second script to 'activate' rather than 'launch' the app to make it frontmost.

Miniaturize Mail won

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