Can't create email links for a keyboard maestro macro

I’m trying to create a macro in Keyboard Maestro to create a link to an email in Apple Mail, open up a new note in Apple Notes, and paste the link to the email in the note. When I run the macro, I get the error message “no linkable item found in Hookmark.” But when I just click on the Hookmark menu icon, it DOES create the link. In both instances, the subject email is highlighted. Any insights? I have checked permissions, rebooted, tried a variety of Hookmark keystrokes, but no joy in Mudville.

It’s not a complicated macro. It just invokes the app, copies the link, opens Apple Notes, creates a new Note and pastes the link that [should be] in the clipboard. But it’s choking at Step two.

TIA

Thank you for contacting us, @dcw96161 .

It seems to me that the problem is that Hookmark is the front document when the “Copy Link” function is executed.

Could you please make sure Mail is the frontmost app for “Copy Link”? See if it helps.

In AppleScript, you can do:

tell application "Mail"
activate
end tell