Moving Between Folders + Renaming + Tagging

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Moving Between Folders + Renaming + Tagging 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.
faborito33
 
Posts: 1
Joined: Sun May 03, 2020 10:39 am

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.
Mr_Noodle
Site Admin
 
Posts: 11870
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support