Populate email from Clipboard

Hi Everyone,

I am trying to populate an email based on user input via checkboxes. My macro has three options and the user tickes the relevant checkboxes. If the checkbox has a value of 1 then it gets added to the email. This works great if all three are chosen but it breaks and puts the contents of the clipboard in the wrong fields if for example the first one and last one is chosen? I am sure that my way is not the best way to do this but i'ts the only way I know and due to font formatting requirements I need to use clipboards.
Should both be in the main content

Thank's for any help, my head is fried as I have been trying to sort this out for about 8 hours now!

From Named Clipboard!.kmmacros (10.1 KB)

I don't know where you want each option value to be inserted, but I'd approach this problem in a different way:

First check the value of each response, and if it's 1, set a variable to the value of the named clipboard. Do that for all three responses, and then you can insert everything directly in the form in Keyboard Maestro, instead of having to rely on tabs and such to pick the right spots in Mail.

This greatly simplifies the macro:

From Named Clipboard- revised.kmmacros (5.6 KB)

Screenshot of macro

Note that I used variable and clipboard names without spaces, as that's a personal preference, but you could change to match what you have. And obviously, insert each value where your need it, as I guessed at where they are supposed to go in the email.


1 Like

I see! Your option is much cleaner than my one and works great. I have implemented into my script and it now finally works! KM is an amazing program but it's a learning curve! Thank you so much for your help, this is a continuation of the macro you helped me with yesterday :melting_face:

No problem, glad I was able to help.