selfire1 / shard

A (still messy) OS-wide Obsidian search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shard: Search Obsidian OS-wide 🔎

A messy way to search Obsidian from anywhere in your OS.

This AppleScript-based solution is rather messy still but works so far. If possible for me I intend to make it work a bit smoother in the future.

⚠️ Limitations: This version only work in one folder. It does not search sub-folders (yet).

Setting up the Script

Download the AppleScript from just above.

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.

Via Hotkey: Hammerspoon

Hammerspoon is a powerful MacOS automation bridge, written lua. Don't worry, you don't even need to know any lua to trigger Shard Search with a hotkey from anywhere.

  1. Download Hammerspoon via it's website.
  2. Open the Hammerspoon application. It will prompt you to create a init.lua file.
  3. 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"

About

A (still messy) OS-wide Obsidian search


Languages

Language:Lua 51.6%Language:AppleScript 48.4%