Subfolder Creation

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

Moderator: Mr_Noodle

Subfolder Creation Fri Oct 02, 2015 10:58 am • by ChrisRankin
Apologies if this is somewhere on here and I missed it. I have looked for some time now. I am so close to getting my recipe correct but can't figure this part out. My objective is to be able to have a folder that has a sub-folder for each of my clients. Each of those client sub-folders (in theory could have 4 Sub-folders titled (for simplicity sake) Apple, Banana, Coconut, and Peach. I have OS X Tags created for those (apple, banana...etc.).
Assuming I save any document with the client's last name and use one of the above tags into the Folder I have the Hazel Rule working on, here are the rules I used.

Rename with Pattern Name
Sort into Sub-folder with pattern Name
Sort into Sub-folder with pattern Tag
Rename with pattern (date added)(name)(extension)

The end result is that if I save a document as Jones with a Tag of Coconut,
Hazel will:
create a sub-folder Titled Jones...perfect
create a sub-folder within the Jones folder Titled Coconut....perfect
Place my file into the coconut sub-folder with the title 2015-10-02 Jones.pdf ... Perfect
This way if there are no Jones Apple files, then there is no apple sub-folder.

The problem occurs when I now have a new document for Mr. Jones. Let's say it is a Banana so I save it as Jones with the banana tag. What happens is a new Jones-1 sub-folder is created with all the other rules operating effectively.

How do I structure things so that instead of the result above, I would only have one Jones sub-folder that holds a coconut sub-folder (with it's files) and a banana sub-folder (with it's files inside)?

Any help is greatly appreciated.
ChrisRankin
 
Posts: 4
Joined: Mon Mar 02, 2015 10:35 am

Re: Subfolder Creation Fri Oct 02, 2015 12:16 pm • by Mr_Noodle
Hazel should use the existing folder when using Sort into subfolder. Are you create the folder using some other means? Check the logs and post/email an excerpt from around the time it creates this folder.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolder Creation Fri Oct 02, 2015 2:23 pm • by ChrisRankin
Well, I think I see/know why it is happening, I just don't know how to fix it. The problem is that using the renaming rules I have, Hazel would potentially, and likely create a duplicate (named) file or folder and thus would necessarily have to be titled Jones and Jones-1, Jones-2 etc.

Is there a good way to accomplish my goal? From my ignorant perspective, the only thing I can do when saving a document of any kind is give it a name and tag it. Obviously I could create a tag for every client, apply that client tag to docs that belong with that client, then structure a rule where the tags would direct where they go. But it seems like there should be a better way than having to create 70/80 different tags.
ChrisRankin
 
Posts: 4
Joined: Mon Mar 02, 2015 10:35 am

Re: Subfolder Creation Mon Oct 05, 2015 2:06 pm • by Mr_Noodle
I'm not following. If using the Sort into subfolder action, you should not get any renamed folders. Where are you renaming the folders themselves outside of the Sort into subfolder action?
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolder Creation Mon Oct 05, 2015 8:20 pm • by ChrisRankin
I guess where I am having problems is in finding a way to separate the client name from description for purposes of continual filing. For example, if I title a file as Jones,T with a Coconut Tag it will create a Jones,T Folder with a Coconut Sub-folder that renames then holds the document. But then I have another file for Mr. Jones, regardless or whether it is a Coconut or a Banana file the only choice I have is to name the File Jones,T if I want it to land in the Jones,T file that was created from that first file. The problem is that I get the message that a file with that name already exists...do you want to replace it...blah blah blah. If I add any kind of description in the title of the file, that will cause Hazel to create a completely different folder, for example if I have the Jones,T Tax file it will now create a new Sub-Folder called Jones,T Tax File. There must be some kind of additional attribute that I can use that would allow Hazel to accurately get to the Jones,T folder that was originally created.
ChrisRankin
 
Posts: 4
Joined: Mon Mar 02, 2015 10:35 am

Re: Subfolder Creation Tue Oct 06, 2015 11:52 am • by Mr_Noodle
You don't have to use the whole name. Search the help for "match patterns". With that, assuming there is a consistent pattern, you can extract the client name and just use that.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolder Creation Tue Oct 06, 2015 1:07 pm • by ChrisRankin
Would it be possible to provide an example? Let's say I have file for Tony Smith that is a widget request. I can name it what ever I want but normally I would name it Smith,T Widget Request.
How do I structure it so the Hazel just looks at the Smith,T part for purposes of filing? I see how to have it recognize the pattern of (word,letter) to pass/fail a rule but I don't see how to segregate the Smith,T from the widget request for purposes of creating subfolders based on name.
ChrisRankin
 
Posts: 4
Joined: Mon Mar 02, 2015 10:35 am

Re: Subfolder Creation Tue Oct 06, 2015 1:17 pm • by Mr_Noodle
The help article on match patterns should have more information on how to do that but you basically want to create a custom attribute to match word,letter so it will capture that for reuse later.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support