AppleScript & Opening/Closing Apps

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

AppleScript & Opening/Closing Apps Fri Nov 01, 2019 7:21 pm • by notmarmite
I'm sending via email a file using Hazel, and some AppleScript.

If I have Mail open when the action runs, afterwards I can close it as usual.

If the AppleScript opens the Mail app, then I have to force quit it.

I don't want to make the AppleScript quit Mail as it may not have sent the message.

Ideally I would want to either close Mail once the message has been sent, or to be able to close it manually using CMD-Q or the menu.

I suspect this is an AppleScript challenge but I'm having trouble finding help as I don't know why this behavior exists. I suspect it's because Hazel is working at the System Events level.

Any pointers much appreciated.
Posts: 5
Joined: Thu Oct 31, 2019 5:32 pm

Re: AppleScript & Opening/Closing Apps Mon Nov 04, 2019 11:31 am • by Mr_Noodle
Do you get the same issue if you run the script outside of Hazel?
Site Admin
Posts: 8567
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Return to Support