Update (2022-12-01): someone posted a simpler version of this shortcut on Reddit.

I write most of my notes in Markdown. The template for my “permanent” (or evergreen) notes looks like this:

# Note title

Created: 2022-04-13 17:42

Note body

## References

- Reference link 1
- Reference link 2
- Etc.


The References section includes both internal and external links. Internal links are easy in Obsidian: I simply type a double bracket ([[) and the name of the note I’m referencing.

External links take a bit more effort. I write them in the standard Markdown format:

[Name of the web page](https://url.com)

I usually copy-paste the page name and URL, which requires a few trips to and from Safari. Switching between the apps adds a bit of friction to the process.

This is precisely the sort of thing where automation can help. I’ve long used Shortcuts on the iPad and iPhone to automate these things, and this sounded like an ideal opportunity to try it on the Mac.

My first thought was: surely somebody’s shared a Shortcut that takes the frontmost page on Safari, copies its name and URL, formats them as a Markdown link, and puts the result on the clipboard. Alas, none turned up on the first page of Google results.

That was incentive enough to give it a shot. This is the result after a bit of tinkering:

Screenshot showing the steps for a macOS Shortcut

Surely Shortcuts aficionados have more elegant ways of doing this. (If so, please let me know.) That said, this works.

Note I’ve enabled it to show up in the Services menu, which allows me to launch it from many Mac apps. (Alas, not Obsidian, where it’d be most helpful. 🙃)

But as it stands, it’s already saving me lots of time. Hopefully, it helps you too. (Next step: bind it to a keyboard shortcut so I don’t have to click around the application menu.)