The Problem
I use Apple Mail on OS X 10.10 and have two mail accounts configured--one for work, and one for personal. More than once when I have composed a new message (not a reply), I have forgotten to check the "From:" address and sent a work message from my personal account and vice versa.
The Request
I am looking for a way to automatically set the "From:" account based on who the recipient is when I compose a new message. If the email is a reply, I want the default Apple Mail behavior (reply from the account that the message was received at).
For instance, say I want to send a message to my co-worker John. So I compose a new message and address it to his work email. I want Apple Mail to automatically detect his email address and set the "From:" account to my work email address.
Of course, the list of these email addresses would have to be created, but after the initial configuration the behavior should work automatically.
Another example: Say that the same co-worker John and I are also friends, and he sent me an email to my personal account to set up a time to get together outside of work. When I reply to his email, I would like the "From:" account to be my personal account, since this is the account that the email was originally sent to.
I don't understand how this seemingly common sense approach is not standard issue for email clients in 2015! Surely I can't be the only one who wants more than the universal default "From:" account that Apple Mail--and every other mail client--offers.
I've looked at the AppleScript dictionary for Apple Mail and read some threads here that suggest that GUI scripting may offer this functionality, but I don't have any experience with that.
Is there a way to accomplish this?