TIP: Automating adding Backlinks with Shortcuts

I’ve been using Drafts for a while to keep my research notes, using Drafts links to make connections from note to note, where these seem useful.

Of course, in this setting, when you link to Draft B from Draft A, it’s nice to know in Draft B that Draft A links back to it. Some note management systems do this automatically, but doing it with all your drafts can make things very messy indeed. (Especially when you want to link out to things that you’d like to keep unmodified.)

Anyway, to experiment with the idea, I thought I’d use the fact that Drafts is so easy to automate, even for someone like me who is not very familiar with javascript. I wrote a little Shortcut which which searches through your drafts tagged with a given tag (mine is “zettel”) and when it finds one such draft that mentions another, but which does link back, it adds a link at the end of the draft that needs the backlink.

It’s my first shortcut with over 5 actions, so no doubt it could be improved, but it’s a start. If you like the idea of your drafts having backlinks, give it a try:

https://www.icloud.com/shortcuts/becef3c82afc4f44a624fb4eadf240d7

And if you’d like to convert the shortcut to javascript so it can run as an action inside Drafts, all the better!

3 Likes

This sounds great. From your use of “zettel” as a tag, I am inferring that you are into the Zettelkasten note taking method. Would be great to hear more about how that works and is working for you.

It’s early days for me, but it’s working well.

I add a new note whenever I’ve got a new thought about something I’ve read, or a talk that I’ve heard, or a new connection occurs to me. I’ve only been doing this seriously for a few months, and so, my collection of research notes is small (around 70 or so), and they’re only sparsely connected. But I’m enjoying the ease of putting new things in, and the ease of searching them in Drafts when I’m focussed on just those notes in a workspace. It’s nice having a place where all that goes, where it’s easy to just jot things down and go back and “tend the garden”, looking for connections, and seeing what arises when I follow the trails I’ve been putting down.

I think the latest beta change log entry may make for interesting reading :wink:

2 Likes

Indeed. When I saw @agiletortoise post about this on Twitter:

that’s what motivated me to clean up the shortcut. I’m glad that this feature is moving up from experimental to beta so swiftly.

It’ll be straightforward to change the shortcut to wiki-style bracket/title links, and this will make the drafts cleaner to scan and easier to write.

Nice shortcut! I’m looking forward to trying it out.

You might be interested in this thread if you haven’t already seen it: Drafts as a bare bones knowledge management system

I’ve also got an action that creates a new draft cross-linked with the currently active one, and an action that creates a temp workspace for all Drafts that link to the currently active one (which I’m planning to update to target a new window).

All of which is to say that I’m really excited to see what others are doing along these lines, and to see Greg’s thoughts on cross-link definitions…

1 Like

The new beta is looking very good. I’m going to spend some time looking through my notes, seeing what it’s like to work with the new format for internal links and search links. At first glance, they make linking a lot easier, and the drafts nicer to read.

I especially like the way the search links take you to the quick search bar. This is going to be really useful.

2 Likes

I would wait until Greg actually ships before refactoring your collection of drafts. There were hints some things might change in the beta process.

1 Like

Oh, indeed. :smiley: I’m just checking how things can go with the new protocols, and giving feedback when things come up — and making sure I have a good backup of my notes so I can revert when/if needed. No drastic changes yet.

2 Likes

I’m really curious to see this if you’re willing to share. Sounds like a fantastic idea on the iPad!

1 Like

Happy to share: https://actions.getdrafts.com/a/106

It’s pretty unsophisticated. When invoked, it filters an existing workspace to display drafts that contain references the current draft’s title. If you’re using Drafts’ wiki link syntax for linking between documents, it’s essentially a way to display all drafts that link to the current draft.

If you’re going to play around with it, I probably don’t need to direct you to change the named workspace “everything” to whichever workspace in your set-up serves you best.

The action opens a new window when run. Current draft gets pushed into a window on the right, filtered workspace on the left, so you can review linked drafts while keeping your original starting point at hand. Admittedly, I still find this a little disorientating— I’d prefer the current draft to remain active on the left, with the filtered list on the right, but I’m not sure if it’s possible to script that yet.

1 Like