Simple AppleScript to enable one macOS Mail account, disable another?

233 Views Asked by At

I have used a simple AppleScript that toggles between active and inactive macOS Mail accounts that has worked peachy up until macOS 10.15 Catalina. I generally trigger this through the Script Menu to hide one account and enable another, but have also tried by simply opening and running it. Either way, it's now failing with the error:

Blockquote error "Mail got an error: AppleEvent handler failed." number -10000

Here's the script: what am I missing here to having this work in Catalina?

tell application "Mail"
set enabled of account "Mac" to false
set enabled of account "Windows" to true
end tell
0

There are 0 best solutions below