28 Jun 2026 · 5 min read
Capturing Links to Drafts
In the past I have employed numerous solutions to capture a link to a web page into another app. I think that in every case I was focused on working in that other app and pulling in a link to the current page, or perhaps a set of links for all open pages. This works fine for most of my use cases, but recently I encountered one where what I actually wanted was to stay in the browser and send the links to the other app rather than pulling links in from that app. That avoids constantly switching back and forth and pulling them in or leaving lots of browser tabs open. To that end I quickly put together something to let me quickly send a link to a web page into my favourite capture app, Drafts.
What About The Share Sheet?
Some of you may be thinking that capturing links from a browser into Drafts is already possible via the share sheet. This is true, and you can capture exactly the information I want (a Markdown link of the page title and the page URL), and append it to an existing draft to get a running list. However, this is a multi-step process. First a couple of clicks to select to share to Drafts, then a few more clicks to get it to append to the existing draft. My approach is simply streamlining the approach so I can just press a keyboard shortcut and know that it ends up being captured where I want it, in the format I want it in.
In addition, while Drafts gives a way to specify the capture format, the options are constrained, and it does not deal with some frustrating edge cases - and I did in fact bump into one of these in my use case.
My Tool of Choice For This Task
So far, I have only needed to do this on my Mac, and while this could be accomplished with a well-crafted Apple Shortcuts shortcut, this is almost trivial to accomplish using Keyboard Maestro on the Mac, and I find Keyboard Maestro triggers to still be a little more reliable than those I assign to shortcuts.
As well as Apple Shortcuts I am positive you could also utilise other tools such as Alfred, BetterTouchTool, etc. You can follow the same basic structure, the same algorithm, and for tools other than Shortcuts, which has direct integration steps for Drafts, you can largely follow the same scripts - though I am dealing with Keyboard Maestro variables, so you would need to modify them accordingly.
Building A Clean Link
The first step for me was to build a subroutine macro to create a Markdown link from my browser’s current page. Because I tend to use Safari for most of my browsing on the Mac, building a basic Markdown link is relatively easy to do as Keyboard Maestro has a couple of special built-in variables to give you the URL and the title of the currently selected tab in Safari.
At its most basic, all I would need is a return step with the text [%SafariTitle%](%SafariURL%), and while that covers 99% of cases, there are a few edge cases we can tackle too.

The issues creep in where the title contains characters that can break the Markdown structure - such as in the Keyboard Maestro wiki. I also like to remove unnecessary whitespace that some sites have in their title. To support that, the full subroutine builds the Markdown link incrementally, starting with the page title, then cleaning the title, before expanding it into the full Markdown link using the page URL.

By splitting this out into a subroutine, it means that if I want to capture as a Markdown link somewhere else in future, I can re-use the same steps and keep that one macro to maintain; should I come across any more edge cases for example.
Specifying a Receiving Draft
One of the things that slows down the share sheet option is the repeated selection of a draft. I want to be able to change drafts, but also to set a draft to receive the Markdown links and then forget it until I need to switch.
To enable that I created a Keyboard Maestro macro to grab the unique ID (UUID) for the current draft in Drafts.

The improved AppleScript support for Drafts made this really quite easy to do. The AppleScript gets the UUID, and then I can save that to a persistent variable in Keyboard Maestro and post a notification to confirm it worked.
I’ve tied this macro to a keyboard shortcut of Ctrl + Shift + 0, and you will note that the capture macro is Ctrl + 0. Keeping them closely aligned like this helps me remember the keyboard shortcut.
Capture Macro
The macro to capture and send the current page link to the specified draft consists of two parts. The first part is to call the subroutine macro to get the Markdown link. The second part is once again uses AppleScript to work with Drafts. This time the AppleScript is a little more involved.
The first half of the AppleScript initialises access the two Keyboard Maestro variables we need - the ID of the draft to append the Markdown link to, and the Markdown link to append. The second half of the script retrieves the content of the draft, and then writes the updated content back with the Markdown link appended as an unordered list item at the end of the draft.

Conclusion
You can download these macros below if you want to use them yourself, or simply use them as presented above for inspiration in how to implement for your own choice of automation tool.
This is not something I need daily, but I found it an interesting diversion this month in that it is actually something I have solved several times before over the years, but always from a position where I was writing first and research bookmarking second. This solution flips that and is for use where I’m working in the browser first and foremost, but I want to log pertinent pages to an external listing.
A final question I will leave you with is how many of your existing productivity and automation solutions also deserve a second look from a different perspective?