Macro to send a url from a browser to another app

Hello - I am new to Keyboard Maestro and trying to get to grips with it! :confused: On my MacBook, I often want to copy the URL of a webpage and send it to another app either to read later (eg with Readwise Reader) or for reference (eg with Standard Notes). I'd be grateful for any suggestions about how I could do this with Keyboard Maestro.

I can see how to open another app (using "Activate"?), but I can't see how to get the macro to capture the url in the first place, and then to tell the app I want to transfer it to what to do with it - eg add the url to Reader or paste the url in a specific document in Standard Notes.

Thank you!

This can be done by the following steps:

  • CMD-L to move to adressbar in your browser
  • CMD-C to copy the url
  • Activate desired destination app
  • CMD -V to paste from systemclipboard

-Neo

1 Like

@Neo's suggestion should work with any browser as way to get the URL and have it ready for pasting.

For many browsers, you can also use tokens such as %FrontBrowserURL%. Here is an Insert Text by Pasting action including that token.

For either approach, you will of course need to prepare things at the receiving end (for Readwise Reader or whatever), that is, set up where and how you want the URL to be pasted.

Have a go at making a macro, and let us know if you need more help. Good luck!

1 Like

Don't forget to look through the manual -- no need to memorise it, but it'll help you know where to look when you need to find something specific.

Hopefully your eye will be drawn to Tokens, particularly those for web browsers. You'll see that, as long as your browser is supported and you've allowed JavaScript from AppleEvents in it, lot's of information is directly available to KM.

In this case you could collect the URL, maybe the document title if that would be useful, from your browser and then switch to the app you want to add the data to. Make sure the insertion point is in the right place, then "Insert text" by typing or pasting.

It's a nice macro to get your feet wet with, so give it a go, see how you get on, and ask more questions if you get stuck.

1 Like

A good point. It is a reminder though of how even "simple" automation jobs can be daunting for new users! @Luckyfish, debugging help is always available here and it will often just need a little extra information, e.g. which browser you are using. So don't feel overwhelmed by it all.

Yes, that's a specific example of what I was getting at by "set up where and how you want the URL to be pasted", and probably what @Luckyfish wants to do, I would guess: have the URL pasted where the text cursor is.

1 Like