Markdown reference links screencast

I made a short screencast of me using the Markdown reference link scripts I’ve shown in the last two posts. There’s no sound; the narration is typed on screen.

A few notes:

Here’s the text that appears on the screen during the video.

This is a screen recording to demonstrate how I use my Markdown reference link scripts.

Let’s say I want to link to the Google home page. If the text I want to use as the link is already in the document, I can just select it and call the New Reference Link command, either from the Scripts menu or through the ⌃L keyboard shortcut. I type (or paste) the URL into the dialog box, and the script runs, adding the reference to the bottom of the document and turning the selected text into a link.

On the other hand, if I haven’t typed the link text yet, I can invoke that same New Reference Link script, and it’ll insert a blank link that I can type the link text into: like this link to

When the URLs I want to link to are already in the document, I call the Old Reference link command, which is invoked through the menu or through ⌃⌥L. If the link text is in the document, I select it, call Old Reference Link, and choose the URL from the dropdown menu. Here’s an example of a link to a post on Nathan Grigg’s blog.

If the link text isn’t in the document, I can still call Old Reference Link, and it will add a blank link to the selected URL, with the cursor between the brackets waiting for me to type the link text, like this link to

That’s all!

6 Responses to “Markdown reference links screencast”

  1. Ryan Gray says:

    Nice. I had begun to play with Sublime Text on markdown files, and it seems it has some reference link completion support. I just got a quick text on my work PC and am going to check it out more on my Mac.

    Do your scripts work with TextWrangler?

    Also, I was getting weirdness when hitting the full screen button on the video. It went full screen, but the video was side-by-side with the blog post in full screen rather than the video by itself. Seems like a Safari bug since when I tried various things putting Safari into full screen, it started messing up full screen mode.

  2. Dr. Drang says:

    I don’t know the answer to your TextWrangler question. I can only say that the shell and Python scripts will work fine, as they are independent of the editor. Whether the AppleScripts work depends on the depth of TextWrangler’s AppleScript library. You could give it a try—just change the

    tell application "BBEdit"

    lines to

    tell application "TextWrangler"

    The only fullscreen weirdness I’ve seen is the extra fuzziness I mentioned in the post. I’ve never seen the video share the screen with anything else.

  3. Tom Reid says:

    Hi I notice in your video it shows keyboard shortcuts for some of the Applescripts in your script menu. How does one do that? Thanks

  4. Dr. Drang says:


    1. Open the Scripts palette via the Window>Palettes>Scripts menu item.
    2. Choose the script you want to assign a keyboard shortcut to.
    3. Click the Set Key… button.
    4. Type in the shortcut you want.
  5. Tom Reid says:

    Thanks! I see from your response that this is limited to scripts within BBEdit. Would be nice if there were a system-wide version of this, but I looked again on Google before I wrote to you and couldn’t find anything.

  6. Ryan Gray says:

    I got them working with TextWrangler and also added some mods to work with named refs. The getreflink script would already list named refs, so that was fine (I did add the ref names to the drop down selections). I just changed the “Reference Link” script to use the output of nextreflink as a default name for the new link that I ask for in a dialog box, so you can press enter to accept the next number, type a name, or even delete it to use the selection as the ref name.