# Obsidian - Moving a note breaks the hook link

**URL:** https://discourse.hookproductivity.com/t/obsidian-moving-a-note-breaks-the-hook-link/3323
**Category:** Discussion & Help
**Created:** [May 26, 2021, 8:14pm UTC](https://discourse.hookproductivity.com/t/obsidian-moving-a-note-breaks-the-hook-link/3323 "2021-05-26T20:14:20Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![voostindie](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/voostindie/32/2143_2.png) [@voostindie](https://discourse.hookproductivity.com/u/voostindie)
#### Post date: [March 12, 2022, 8:42pm UTC](https://discourse.hookproductivity.com/t/obsidian-moving-a-note-breaks-the-hook-link/3323/8 "2022-03-12T20:42:18Z")

</div>

I prefer `obsidian://` links over `hook://` links, because the first open in Obsidian, and the second do not; they open files in the default Markdown editor, which _cannot_ be Obsidian, AFAIK.

I do no like the default `obsidian://hook-get-address` script much because it uses the macOS clipboard, and I’m not in favor of installing extra plugins, like the Advanced URI plugin.

So, I had a go of my own at solving this.

The solution I implemented works without the clipboard, generates fairly stable `obsidian://` URLs, and is quite a bit faster than the built-in script. Caveats:

- Document names are considered to be unique within a single vault. i.e. there’s only one document called “Foo”. For me, that is always the case. I use folders, but sparingly. I never create two documents with the same name in different folders.
- Moving documents within the vault does not break their URLs. Renaming them does, however. I can live with that, for now.
- I implemented the necessary logic in Ruby, because I’m not good at AppleScript. Nor do I want to be.

[Here’s the gist.](https://gist.github.com/voostindie/8d854650f7d01747b0417ed00d049259).

You will definitely need to modify it to accomodate your own situation - especially the paths to the Ruby interpreter and the script itself need fixing - but hey, maybe it’s of use.

---

_[View the full topic](https://discourse.hookproductivity.com/t/obsidian-moving-a-note-breaks-the-hook-link/3323)._
