How do you use Hazel in conjunction with Obsidian?

Self-explanatory title. I’ve seen a few people use Hazel. How do you use it with Obsidian? https://www.noodlesoft.com/store

I was going to make a similar post on this! I am on a Windows machine, but I have been experimenting with File Juggler (similar to Hazel) in conjunction with my Obsidian vault. I’m loving it.

So far some recipes I have found very helpful in my workflow include:

  • when there is a full article with enough to it that I want to clip it direct to Obsidian for further review/processing, I use the Markdownload extension in my Chrome browser (one click). Then based on that file name convention and the #source-material #toProcess tagging I have configured in the extension, File Juggler (1) renames the file to the date + a cropped page title (derived from a regexp); (2) changes the file extension to .md; (3) moves it from my downloads to a specific Inbox folder in my vault (which I hide from graph view by default). This also works, of course, for any specific passages highlighted and saved via that extension.
  • There are a few types of notes that I like to keep tidy in their own folders rather than scattered among my working note space. For example, when I create a new note about a person, my template includes a #type/person tag. I have a File Juggler rule that automagically moves these into a People folder.

That’s a great use of Markdownload! I am copy-pasting with it a lot (sections of text), but this could automate the process somewhat.

Regarding the moving of files - this is exclusively for newly created files I guess?

I’d like to move and shuffle files around a bit (and rename them) with sth like Hazel or Juggler, but Obsidian won’t update any links then (and I use relative links, so that’s a no-go).

This script seems particularly useful https://www.noodlesoft.com/forums/viewtopic.php?f=3&t=9776&p=25943&hilit=Yaml#p25943

Think I’ll take it for a spin later today.

At least in my vault, nothing breaks when I move files into different folders…but I don’t do any automatic renaming once I have a file/note linked.

Other Obsidian-specific rules I have set up since I posted that:

  1. Even though I’m using the mobile app now, I still often capture notes in Drafts or a clipper app. I’ll batch-export these as text files to Dropbox, and my FJ rule will move them to my vault and change the extension to markdown.
  2. Experimental: I have some consulting/client documents and work products where I want to preserve elements as notes. If I drop a copy of a Word document into my vault, I have a rule that runs pandoc on the document, converts it to markdown, moves it to my Obsidian Inbox, and deletes the original. I’m a bit green with pandoc and haven’t mastered how to get word tables to translate neatly into Obsidian markdown tables, but I expect I’ll crack that nut soon.

I’m doing something similar with my Hazel/Obsidian set up. I have Hazel watch my Drafts inbox and changes it from *file.*txt to *file.*md and move it to my Obsidian Inbox folder for processing.

I also have a second rule going that watches my full Obsidian vault for specific YAML to sort it into my preferred folder. For instance, I have it watch for category: people and have it send to my People folder so it’s out of the way.

Still in my early days for Obsidian and Hazel ideas though.

2 Likes

Would you care to share your settings for Hazel? I wan’t to do something similar - letting tags decide which folder notes go to. Where in the notefile does hazel find the YAML?

Also, this should also be possible to do in DevonThink if you index the vault or not?

It seems that Hazel cannot read contents from yaml. Can you share how you’ve configured it?

I use Hazel to move daily notes that are more than 2 months old from the root of the vault to an “Archive” folder.