Copy-Pasting Text With Source Meta-Data

Hey! I'm completely new to Keyboard Maestro. After reading some beginners tips exhorting newbies to ask questions, I thought I'd ask my question even though it feels a little too unspecific for anyone to be able to help with. This is probably going to be beyond my powers, but I thought it worth asking.

I'm a law student, so I spend a lot of time reading and gathering notes. In an academic setting, it's obviously super important to cite your sources. A tricky part of this is finding an efficient way to distinguish between when you've copy-pasted something directly (which is much faster than rewording it yourself) or you've reworded it. It's also just annoying to have to copy the text and then copy the source, and having to reformat the source in such a way that doesn't get in the way of the actual text (I.e. Cmd + K with a URL so that it doesn't take up several lines of text). Another issue is when I need to cite not only the source but the source which the source cites. For example, I often read textbooks which describe what judges have said in X case, so there's like two layers of citations (the primary citation for the judge, and the secondary citation for the textbook that interpreted what they said. This quickly becomes messy and slow. A third problem is that all of this just generally makes it difficult to quickly and reliably distinguish my own ideas from other people's ideas. I end up using different methods on different documents, because sometimes (like when I'm working to a deadline) I don't have time to use a more elegant method so I use a quick and dirty method. As a human being, I'm obviously also fallible and unreliable, so I'm more likely to be sloppy working at 8pm than I am at 11am. Having some kind of automation to do this for me would save me a HUGE amount of time, and would generally make it easier to study without having to break my flow constantly to make sure I'm keeping track of where I got the information from.

My question: might it be possible to create an automation that allows you to copy text along with metadata as to it's source, and then automatically paste that metadata alongside the pasted text in a decently clean fashion.

For example, one way I imagine this working is:

  1. Highlight some text in a browser with my cursor.
  2. Hit a certain keyboard combination which copies (I) the text I've highlighted and (ii) the URL of the page I'm copying the text from. I don't even know if you can copy two things at once like this...
  3. When I paste the text in a document (e.g. MS Word), the text pastes into the document as usual, and the source URL get pasted as a little bracketed hyperlink just to the right next to the text (like this: The text I copied (source) where "source" is hyperlinked with the URL).

I know enough to know that building an automation which does this will often depend on the application I'm getting the text from as well as the application I'm pasting the text to. I'd also love to be able to do the same thing with pdfs, and I'd like to be able to paste stuff into my LogSeq and Notion pages, but I suspect I'd have to either create different automations or build something altogether more complex.

Also, if anyone knows of any other tools (I.e. other than Keyboard Maestro) which might be able to help with this, I'd really appreciate that intel!

Thank you kind people <3

Welcome to the KM Forum Tommie.

To get you started you might want to take a look at this macro;


Hello, welcome.

Yes you can, thanks to the Clipboard History. Alternatively you could use Set variable to clipboard after each copy, if that suits your macro's logic better.

However, you probably won't need to copy the URL anyway, thanks to KM providing a token for the current URL. %FrontBrowserURL% is probably the token you'll want to use if you're using Safari or a Chromium-based browser . Other ways for other browsers are possible (something is nearly always possible with KM! :slightly_smiling_face:).

So for that you might use the string:
%SystemClipboard% (<a href="%FrontBrowserURL%">%FrontBrowserURL%</a>).

I believe KM should have all you need!

(2023-03-27 10:06 - edited to improve formatting).

MS Word isn't your main repository for notes, is it? If it is, and it works for you, great, otherwise may I recommend you try Obsidian.

I appreciate this because I'm actually a huge PKM / note-taking software nerd.

I currently use Notion for law school organisation and note keeping (for the database functionality—although the lack of an offline function is leading me to lool eleswhere). I really want to try out Tana if I can get an invite. I also currently use Logseq, and am a former Roam, Workflowy user.

Obsidian isn't to my tastes, although I have considered it several times since it came out. I did used to use Dynalist (which was the Obsidian creators' project before they made Obsidian). I just switched to Scrivener for longer writing.

If you, or someone you know, has a Tana invite, please let me know!