I searched for how to send email without opening apple mail, and found the question AppleScript - How to send a email without the mail app opening up
However, I'm doing this with Keyboard maestro, so that I can send a specific email using a hot key in any application. After googling for the solution I found this script that does the job well:
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:"hello", content:"You got a new file in your Downloads folder, girl!", visible:true}
tell theNewMessage
make new to recipient at end of to recipients with properties {address:"myemail@mail.com"}
send
end tell
end tell
One problem: I want to do this, but instead of hello in the subject, I want to have the clipboard. Googling for that, I found two things
keystroke "v" using {command down}
or
return (the clipboard)
I tried to teplace "Hello" with those two. But none of them work.
I don't know applescript, thus googling around and my question here.
Here's a script that happens to work for me very well. I'll just post it as an example.
I use this script after clicking on an e-mail address in the browser. I choose the relevant Mail script from my AppleScript menu after making sure that the text insertion point is in the subject line of my e-mail.
This worked for me: