Can't seem to get variables & clipboard to work

I'm trying to create a macro that creates a new Gmail compose window and populates the subject and body with the url and web page title of the web page I'm currently on.

Here's the Macro:

So all I'm asking it to do is to save the current url and page title to variables, then open a new Gmail compose tab and to past the variables to the subject line and email body. But it's pasting nothing, and when I click on the "view" button for the two paste actions, they're showing blanks. Am I missing a step or something?

Normally you would use Insert Text by Pasting actions rather that the functionally similar Set Clipboard to Text / Command-V.

You can see the variable values using the Variables preference pane in Keyboard Maestro, but Keyboard Maestro also tells you what it will set the values to at the bottom of the Set Variable action.

It is showing you that the variable currently has no value, and if the action were run right now, it would have no action afterwards either.

The tokens look right (unless there is an invisible character in them or something like that), so that would make me think that for some reason Keyboard Maestro cannot communicate with Safari via AppleScript, which is pretty weird (its quite common with Chrome and seems to happen after Chrome updates itself). So perhaps you updated Safari and the AppleScript system has lost its connection to Safari. Try:

  • Quitting and relaunching Keyboard Maestro Engine.
  • Quitting and relaunching Safari.
  • Restarting.

Until you can see the current Safari URL in that first action, you're not going to get anywhere.

Thanks. I finally got it to work but I had to use the "universal" "set variable to..." command instead of the Safari and Chrome-specific "set variable to..." command.

FWIW I did notice some oddities as far as timing goes. I have my macro set to paste the web page title in the email subject line, then tab down to the body and past the web page url. I had to put a half-second pause after the tab to get it to work, but while experimenting with the timing, if the timing was too short, it would past the url twice.

Anyway, thanks for the help and here's the script for anyone else who's interested: