Automating Markdown Links

I am no programmer, but I like to fiddle around with HTML and AppleScript every once in a while. In writing my Mountain Lion coverage in the past weeks, I have relied on a number of tools to speed up my writing and be more efficient.

The most tedious part of writing in Markdown, for me, is inserting links. More specifically, I use inline links, and I like to have both a webpage’s URL and title when I am linking to it, so that the converted HTML will have proper location and title attributes. For this reason, I have modified a number of existing Keyboard Maestro macros and bookmarklets to suit the process of inserting inline links to my tastes.

The Keyboard Maestro macro I use is a modification of the “Link New” one found in the Keyboard Maestro Markdown Library. With the addition of two simple AppleScripts, it automatically grabs the URL and title from the frontmost Safari window (and active tab) and it places them in the URL and title field of the macro’s dialog box, so I only have to hit okay.

Keyboard Maestro

I use this macro all the time when I write in Scrivener, Evernote, or TextEdit, but I also keep the “regular” version around for when I’m writing in the browser, making the process of inserting the URL a manual one (though I use this macro to grab a webpage’s title).

You can download the macro here, but make sure to check out the original bundle as well.

If you don’t want to use Keyboard Maestro, I have put together a modified Walter Higgins’ bookmarklets for inserting links in Markdown to work better with the inline and reference link formats. The first one places URL and title in brackets, with the title wrapped in straight quotes. The second one works the same way, but there are no brackets, so you can easily paste its contents after the [id] of a reference link at the bottom of your document. Personally, I use these bookmarklets all the time when I’m writing on iOS. You can install them by copying their text from the links below.

Again, if you need to quickly wrap words in square brackets, I recommend the Keyboard Maestro Markdown Library.


Now read this

When Realism Doesn’t Age Well

In watching the latest gameplay footage of The Last Of Us from PAX, I was reminded of a subject I’ve always wanted to tackle with a few words: realism in videogames doesn’t age well. Recently, I’ve started playing the original Metal Gear... Continue →