I have to send a lot of boilerplate/standardized emails for work, but they are too irregular for a mail merge to be helpful. So I came up with this solution that acts on currently selected text. I store my boilerplate text files in nvALT. When I need to run one, I just open it and select the text and execute the macro. The text contains placeholder flags that prompt the macro to turn them into fill-in-the-blanks.
Here's an example of the kind of text I would use:
SUBJECTYour Magazine photographer
Hi Dr. xxxDoctors_Name,
Thanks again for your willingness to be photographed for our magazine.
Your photographer, xxxPhotographers_Name (CCed), will be following up with you to set up a convenient time and location for your shoot.
Please let me know if you need anything. Thanks!
Here's a basic overview of the macro:
- Gets the text and saves it to a variable for macro operation (original text file in nvALT is unchanged)
- Searches for any placeholder string that begins with "xxx"
- Creates a variable for that text and prompts the user to assign a value to that variable
- Goes back through the text and overwrites the placeholder string with the user-assigned variables
[Steps 2–4 are repeated for all placeholder text with a "For each" action.] - Finds a string that begins with "SUBJECT"
- Sends everything to a new email message
(I know TextExpander supports fill-in-the-blank snippets, but I find them clumsy, and I much prefer to store my boilerplate text in nvALT, where I can get to it easily.)
If anyone has suggestions for improvement, I'd be interested to hear them.
BPT.kmmacros (7.5 KB)