Copy Javascript Variable to Keyboard Maestro Clipboard

I am extracting some HTML from a web page

full_name = document.querySelector('h1.searchable').innerHTML

How do I pass full_name to Keyboard Maestro so I can goto another application and paste it?

Thank you!

The simplest approach might be something like this:

or for Chrome, this:

(function() {

    return document.querySelector('h1.searchable').innerHTML;

})(); 

i.e. KM's Execute JS in Browser actions pass the return value of your code back (as text) to the action result, which you can then put in the clipboard or a KM variable, or use in some other way.

2 Likes