

User scripts that make things a lot easier for me. Use the metadata `assigned` like `(assigned:: Matt Turk)` in these.Īnd my check-in template looks like this: I recently formalized something that I do in all of them, which makes it a lot easier to set up.įor instance, my meeting-notes template looks like this: Templater plugin, and I have setups for note taking for meetings and check-ins with students.

But I found that to be a non-issue as Spotlight is quite accurate and my filenames are descriptive enough.Obsidian for personal note taking and whatnot. One limitation of Spotlight is that we can't show a snippet of the note. No need to switch to Obsidian first, before you can search.

There’re a couple of reasons I prefer this setup over the built-in quick switcher or search feature of Obsidian: Pick any result, hit enter, and Obsidian should open the correct note. Now try it out! Open Alfred, type "note", followed by your query and watch the results appear. The "Open URL" is configured to take the highlighted result and pass it to Obsidian: To fix that, connect an “Open URL” action to the script filter: The Python script uses mdfind to search your notes and gives the results to Alfred in a specific JSON format.Īt this point, Alfred will show search results, but nothing will happen if you click on a result. Print (json_object ) # Alfred will pick this up PIPE, text = True ) as proc :įor path in iter (proc. VAULT_PATH = "/path/to/your/obsidian-vault"ĬOMMAND = """Use Spotlight to search an Obsidian vault and present results to Alfred""" Alfred should only show the results and don't mess with it. Deselect the option "Alfred filters results".Set the programming language to Python 3 (must be installed first).You need to enter a query before the script should run. Set the keyword to “note” (or anything else you prefer).I added a script filter and configured it as follows: You can search inside any folder by using the following command: mdfind "search query" -onlyin /path/to/obsidian-vaultĪrmed with this knowledge, I created a new workflow in Alfred. Much to my surprise, I found Spotlight has a command-line interface.
#OBSIDIAN FOR NOTES MAC#
Then I realized every Mac has a great search engine built-in: Spotlight! Spotlight's command-line interface The first question is: how can I search through my notes? I initially wanted to use grep, but that's inefficient as it doesn't build an index.

My goal is simple: create an Alfred Workflow that allows me to search through my notes from anywhere. You can search through it using any tool that can search files on disk. Here's a screenshot of the Workflow in action:Īn Obsidian vault is a folder on your local hard drive with text files inside. Note: the instructions below require an Alfred Powerpack. Hit enter and the correct note opens in Obsidian. I just open Alfred, type “note” followed by my query, and see my search results. In this post, I’ll show you how I integrated Obsidian into Alfred so I can search my vault from anywhere on my Mac.
