Keyboard Maestro Macro: Docu Store

As a blogger (I’m sure this applies to others) there are a lot of times when I am writing and need/want to grab a lot of source material to use. For me this typically involves a lot of copy and pasting and command-tabbing between Safari and Writer.

I was fed up with this, so I created a system where I could just copy an infinite amount of data and paste it back into an app all at once.

Enter Keyboard Maestro: with these two macros you can write things to a simple text file with one shortcut and then paste it back out of the text file into your writing (and then you clear the text file). This is all done quickly and simply.

Here’s how:

Docu Store – Build

The first part I had to build was the engine that would write everything I want to a text file. Here’s how I did this:

I’ve set the hot key trigger to CTRL+CMD+C so that it is not something easily triggered on accident, but only one modification from a standard copy command.1

From there, Keyboard Maestro performs three simple actions:

Copies the text so it is on your clipboard.

Appends what is on your clipboard to a specific text file. In my case that is stored in Dropbox, in a Workflows folder, with a file name called Docu-store.txt. This writes the info you want to the text file. I’ve further set it to write in plain text, thus removing any formatting.

The last bit is a simple formatting preference. If you don’t add this part, all the stuff you copy will all be on one line. I’ve added two carriage returns between each entry add by telling Keyboard Maestro to append %Return% %Return% at the end of every add to the file. This way, when my text is pasted in the next macro, it is easy to see. (You can also use: %LineFeed% %Return% %Tab% %Space%.)

That’s it for the first macro — we can now add text. Next we just need to extract it.

Docu Store – Paste

Now we need to extract that text back out of the file and paste it at will.

Here’s how I have that setup:

I’ve kept things standardized by using the CTRL+CMD+V shortcut. From there Keyboard Maestro runs four actions:

I first set the contents of the text file we were writing to, to a variable called DocuStore. All this does is get data in a place where we can use it. (I first tried loading the data directly to the clipboard, but had very inconsistent results when I did that — this seems to be the most predictable way to get the file contents.)

Next I set the clipboard to the DocuStore variable. (Again, this could be one step, but it wasn’t working correctly for me.)

The data is then pasted by hitting CMD+V.

This last action is one you might want to think about not adding. I write back to the text file nothing — which clears everything out of the text file, making it a blank slate for the next round.

All of that gives you a nice clean way to grab say an author name, link to the article, and block quote from the article — all in one fell swoop.

I love it.

Notes & Tips

You may not always want to wipe the file, so there’s an easy way to make that an option you can decide on at the time:

By adding that one action a dialog will pop up asking if you want to wipe the file. Say no and nothing is done.

Lastly, I use a text file because it is a non-volatile way to store the data. It will persist if you restart your Mac, it won’t be wiped out for some odd reason, and is backed up. You could use a custom clipboard for this, but a text file has an added advantage of being a document you could just open and edit if you wanted or needed.

An added bonus, that made it easy to remember, was that it is the Windows copy shortcut and the Mac copy shortcut in one. ↩

Become a Member

Members receive access to exclusive weekly content, and help keep the site running.

Article Details

tl;dr

(This post is a part of a series on Keyboard Maestro, see more here.) As a blogger (I’m sure this applies to others) there are a lot of times when I am writing and need/want to grab a lot of source material to use. For me this typically involves a lot of copy and pasting […]