Using Keyboard Maestro to create an HTML emails wrap around Markdown text

I have a couple of HTML templates for my clients where the only thing that changes is the content in the middle. Every time, I manually replace the old content in my web editor, copy all the code, and send the email to my clients. I'm wondering if Keyboard Maestro can help me speed up this process by allowing me to select the email, hit a key shortcut, and have all the unchanging code appear around the text. This would make sending my emails much faster. My vision is to write the email, select it, use a key shortcut, and then send. Is this possible? Thank you in advance..

To interpolate changeable content into a template, you can use Keyboard Maestro tokens, either through the Keyboard Maestro graphical user interface, or by applying the Keyboard Maestro Engine .processTokens method to a template through JavaScript or AppleScript.


The next step is, as always, to show anonymised examples of:

  1. A typical input set of inputs (a template and some variable content), with
  2. a corresponding sample of the expected output.
1 Like

Sorry if I'm asking you something out of line. Can you create a step-by-step example on how to do that? I just need to see how it's done in order to get the general idea. You can do something like:

  1. Create a macro in KM
  2. Click on this:
  3. Paste the code here:

Once I get the idea on how it works, I will be able to create KM for other needs. Thanks

As above. We can't really help you without a concrete sense of your workflow.

i.e.

  1. example of input(s)
  2. example of expected output

If I understand you correctly, you could hit the trigger key and then:

  • ⌘↑ to the top of the mail
  • paste your heading from a named clipboard
  • ⌘↓ to the bottom
  • paste your footer from another named clipboard