Page 1 of 1

Moving Between Folders + Renaming + Tagging

PostPosted: Sun May 03, 2020 11:24 am
by faborito33
Hey guys,

Relatively new to Hazel (I've been a hazel user since forever but have created just a few recipes so in that sense I'm a noob.

I'm trying to do something but I'm stuck:

What I have right now is a system that's fairly simple but works for me when it comes to files that enter my Downloads folder:

- I check what type of document it is: PDF, Excel, etc and move them to a specific folder by type.

Super simple.

Now, I want to up the complexity a bit:

- All files will enter the Downloads folder.
- I'll tag them based on the project they belong (i.e: clientA, clientB, etc).
- Based on the tag, I'll move them to the project folder (clientA project folder, etc).

Up until here, I'm good. Hazel is super straight with this.

Here's where I'm stuck:

When a file enters the project folder, I want the file to be renamed based on the source. So if the folder is clientAproject and a file called invoice.pdf comes in, then the name ends up being clientAproject_invoice.pdf.

This is can do, the issue that when the rule runs again the file ends up being called: clientAproject_clientAproject_invoice.pdf. And every time the rule runs, it just keep getting renamed.

I understand why in the sense that Hazel is just doing the rule set, but I can't find how to add a condition that would say, if th file already has the source folder name in the name, ignore it (or something alongs those lines).

Can someone help me out with this?

Thank you.

Re: Moving Between Folders + Renaming + Tagging

PostPosted: Mon May 04, 2020 10:19 am
by Mr_Noodle
You'll need to either add a tag to indicate the file has already been processed, or use a match pattern to see if the file is already renamed in the format you need and not match the file again in that case.