Page 1 of 1

Using forward slash in rules

PostPosted: Fri May 20, 2022 6:23 am
by rokhro
Hi all,

I am trying to create a rule to move files in my Obsidian folder.
My rule should pick up an .md file that has 'what/source/article' in its contents. Essentially, I am tagging articles with 'what/source/article' tag in Obsidian, and would like Hazel to move that file to a folder where I would like to have all my articles stored.
For whatever reason, whenever I am trying to debug this the rule Contents contain what/source/article fails to match. The only workaround I found that works is to create three separate conditions:
- Contents contain what
- Contents contain source
- Contents contain article

This way the rule matched and files got moved.
This made me think that the forward slash is the problem.
Is there any solution to this? Or the workaround I came up with is the only way to match a string that has forward slashes in it?

Thank you

Re: Using forward slash in rules

PostPosted: Fri May 20, 2022 9:13 am
by Mr_Noodle
"Contents contain" uses Spotlight so it may be a limitation of how Spotlight indexes words. If you really need to do it with the forward slashed, use "Contents contain match" instead. Note that it is more resource hungry.