r/applescript • u/halfmanhalfalligator • Jan 22 '20
Enable/Disable Mail Account via Applescript?
I’m trying to find a solution to switch an email account on and off via Applescript.
I’m using the same Macbook/Mail.app for work and personal stuff and would love to automate some sort of fixed schedule to disable my work mail account after work hours and on the weekend.
Any solutions, tips, recommendations are welcome, thanks!
4
Upvotes
View all comments
Show parent comment
1
u/[deleted] Feb 29 '20 edited Feb 29 '20
Hi there
I have the same desire: to turn off work email more easily than going into preferences, selecting to enable/disable etc etc. And yes, timed would be good!
So I tried your script above - using the account name in the field 'Description' when I select Preferences --> Accounts in Mail. I get the following error in Script Editor:
"Mail got an error: AppleEvent handler failed." number -10000
Any thoughts why?
For reference this is the script I used, exactly:
macOS Catalina 10.15.3