Creating my first macro

I would like to create a macro that takes a screen capture I create in Chrome, then switches to Mail, creates a new mail, addresses it to a specific person, types the subject line, pastes the content of the clipboard and then sends it. I’ve been trying to do this since I downloaded the program, but I’m obviously missing something. I’m computer savvy but not a programmer.

Also, I use Alfred to call, start or use certain programs or functions. How can I use the keyboard mapping I have (⌘ space) to call it, or should I just dissect the Alfred workflow and do it directly in Keyboard Maestro.

In advance, many thanks.

Hi @bocaboy, here is a macro with the desired functions. This works globally and can be applied in any app.

Here is a short video.

"Google Translate is my best friend" :wink:

Screen_Mail_Makro.kmmacros (24,0 KB)

Thanks! I got the e-mail to be created but still have a couple of problems that I hope you can help me with.

  1. After the e-mail is created, I'd like the cursor to be placed in the body and to paste the current contents of the clipboard. I've tried using the tab key (repeated 6 times) followed by the paste key, but it doesn't seem to work.
  2. I don't seem to be able to get Signature to work, even though it is correctly configured in Mail. I've tried using "Default" but the result is the same.

This is my first macro, so please accept my thanks for helping to show me the ropes!

Hi @bocaboy, I am trying to help.
I need to ask, because I do not understand exactly what you want to do.
Could you please post a screenshot of a finished mail?

Here in this video is my mail workflow. Is this to be so similar with you?
If a macro does not run properly, then always set a short break between the actions .4 or .6.

Do you really want to work with the tab button, so insert something sideways?

Please excuse my English. Was not a good German student :relieved:

You can use the %CurrentClipboard% token directly without resorting to a Paste action:

[test] Mail.kmmacros (1.9 KB)

There (still) seems to be an AppleScript issue with the signature on Sierra. And for this action KM is using AppleScript under the hood. See here:

1 Like

Tom, thanks so much for your input. I caught on after I posted that I could use the token as you suggested. The good news is I now have created my first macro which I will use every day! Thanks so much for your help!

appleianer, thanks so much for all of your help. I followed Tom’s directions (an addition to the original post) about inserting %CurrentClipboard% as a standalone token.

I now have my first macro, which I will use daily! Thank you for your direction and help!!

1 Like

There will be many macros to follow, each of them will (hopefully) make your life easier, but each of them also has the potential to make your life more complicated, because of all the traps, bugs, unknown territory you’ll come across.

In that case just post here in the forum :slight_smile:

Well I spoke too soon. What I’m trying to paste is an image. When I use the token %CurrentClipboard% it creates an error “No Text In Clipboard”. There doesn’t seem to be a token for pasting the last current content of the clipboard, which in my case will be an image.

So here’s the workflow I’d life to create.

  1. Capture an image daily. Every day will be a new image
  2. Paste that image into the body of the e-mail that has been generated by KM

I’ve created a named clipboard, but for the life of me I don’t see how to paste that content in the body of the e-mail. I am also concerned that the named clipboard won’t be updated every day but be a permanent image, or at least that’s what I see from the documentation.

In that case (picture on the clipboard), it seems, you really have to use a Paste action:

[test] Mail.kmmacros (2.7 KB)

Tom, that does not work. What would be ideal would be to insert the keystroke CTRL-V at the cursor location, but I can't even get the cursor to position correctly. Here's what I'm current doing:

Can you elaborate on this? Just tested it again, and it works (with clipboard content being picture data.)

First, a potential important issue, I’m running High Sierra, not Sierra. Nonetheless, it shouldn’t be a problem.

When I run the macro, it creates the e-mail and addresses it correctly, but the image isn’t pasted. I end up with the address highlighted and no visible cursor and the image is not pasted.

Do you think this is an issue with High Sierra or am I just doing something wrong?

If the macro as posted above does not work in 10.13 then I think it may be related to 10.13, yes :wink:

I will install the 10.13 GM as soon as it is released (couple of days), but I will will not install any beta before that (at least not on this machine). You see, I’m really conservative.

The text position pointer needs to be positioned in the email body before the paste. I have a AppleScript somewhere that does this. I’ll look for it.


Hmmm, there’s a new build out today. Let me install that and see if it makes this any better.

Well, it seems it is not the GM Yet.

JMichaelTX, thanks for the response. I’m positioning the cursor in the body of the mail with %|%. (See the pasted workflow above.) Shouldn’t that position the cursor where I want the image to be pasted. It’s too bad that this can’t be simplified with a token like %paste%. I understand the reason for named clipboards if the pasted image isn’t meant to be dynamic, but if all I want to do is paste the current system clipboard in the body, it sure seems overly complicated.

I don’t think they’ve announced a release date yet.