I have been looking for the option to open a note in Obsidian from anywhere in my system for a bit and finally put together a (messy solution). Let me present:
Shard Search
→ Find it on github.
The URI scheme opens the possibility to open a note from anywhere in the system now!
I put together an applescript that lists all notes in the vault. Once you pick one, it opens it in Obsidian.
Limitations: This version (I think) only works in the main folder of the Vault. It doesn’t work in sub-folders (yet).
The Script
You can find the AppleScript on Github.
In the first couple of lines there is minor personalisation required:
- Edit this path to point to your Obsidian Vault:
set chosenFolder to "Macintosh HD:Users:Path:to:Vault" as alias
- Replace “Vault” with the name of your Vault right here:
set vaultName to "Vault"
How to use it
Quick + dirty: using Alfred
Using Alfred, you can simply search for the file name of the script, press enter and start it from anywhere.
Smooth with Hotkeys: Hammerspoon
Hammerspoon is a powerful MacOS automation bridge, written lua. Using it you can trigger the search from anywhere in the OS straight with a hotkey. And don’t worry, no lua required.
- Download Hammerspoon via it’s website.
- Open the Hammerspoon application. It will prompt you to create a
init.lua file.
- Replace the
init.lua with the file from above. It is supposed to live in ~/.hammerspoon/init.lua
Personalise the script
- Open the with a text editor (like Atom)
- Modify the hotkey if you’d like to:
hs.hotkey.bind({"cmd", "alt"}, "O" (default is cmd + alt + o)
- Edit this path to point to your Obsidian Vault:
set chosenFolder to "Macintosh HD:Users:Path:to:Vault" as alias
- Replace “Vault” with the name of your Vault right here:
set vaultName to "Vault"