Close Mail window on "sign in"
I want to be able to close the Mail window/s if open when I sign in. I placed this script into login items and it does not fire when I sign in and the Mail window is open, yet it does fire when I click on it in the login window.
So, if the mac is asleep and the mail window is open and I sign in, the script does not fire. Does it need additional language, since I am signing in to a mac that is just asleep and is asking for a password since the energy saver sleep setting is beyond the 3 minutes it is set to? Running Catalina
Thanks
tell application "Mail"
try
close every window
end try
end tell
iMac Line (2012 and Later)