Folder Structure

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Folder Structure Wed May 26, 2021 5:32 pm • by rober1y
I have read previous posts about this and at one time had a Hazel rule that worked. Something changed and now it doesn't. Here is my issue: Whenever I get a new client, two folders are created. The first is the name of the client (ex, John Doe) and a subfolder that is the matter (ex, Donation). My old Hazel rule would then populate the matter subfolder with 10 new subfolders for that matter (ex. documents, correspondence, word processing etc.)

I tried to find the old rule online and now have the follow Hazel rule:

"If all of the following conditions are met:

Kind is folder
Subfolder Depth is 1
Name does not start with untitled

Do the following to the matched file or folder:

Run Automator workflow: Create Client File Folders

When I preview this on a Matter folder "Subfolder Depth is 1" it does match, but doesn't create the 10 sub-subfolders in the Matter folder.

When I change to "Subfolder Depth is 0" it doesn't match on the Matter subfolder, but does match the top level (Client name) folder and it puts the 10 sub-subfolder structure there.

Why doesn't it put the structure in the subfolder I want it to use? Help!
rober1y
 
Posts: 11
Joined: Fri Nov 11, 2016 12:02 pm

Re: Folder Structure Thu May 27, 2021 10:47 am • by Mr_Noodle
Try going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Report back with the output from that.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Folder Structure Wed Feb 01, 2023 3:18 pm • by rober1y
I've gone through the Troubleshooting guide and copied the log for the time when the Rule was processed. Again, what I am trying to accomplish (and once had working) is as follows:

1. A [Client Folder] is created automatically by my office management software when client data is added by me to the office management software. That folder is also located within an existing folder I will call [Management Software Folder].
2. The office management software also creates a [Matter Folder] located inside the [Client Folder].

So the existing folder structure looks like this:

-[Management Software Folder] (This is the folder monitored by Hazel)
--[Client Folder] - This folder will have at least the following folder located within (if a repeat client, there could be more):
---[Matter Folder] This folder will be empty. However...

I used to have a Hazel Rule that created a set of standard set folders within the "Matter Folder" (Correspondence, Notes, Documents, etc). Somehow that got corrupted or lost or whatever.

The rule was inside the Hazel "Management Software Folder." The action was "Run Automator workflow" which I created using instructions from another website that created the file structure inside the "Matter Folder." That website had the Hazel Rule as follows:

If all of the following conditions are met:
Kind is Folder
Subfolder Depth is 0
Name does not start with untitled

https://georgecoghill.wordpress.com/201 ... tor-hazel/

That rule was not a match for the [Matter Folder]. It ran the Automator workflow creating the folder structure I wanted in the [Client Folder] when I want one level down in the [Matter Folder]. So, I changed the Subfolder Depth to 1 to read as follows:

If all of the following conditions are met:
Kind is Folder
Subfolder Depth is 1
Name does not start with untitled

This results in a "Rule Matches" on all conditions when tested on the "Matter Folder."

However, the Automator workflow doesn't run. No subfolder structure is created.

I think this is the Log entry when I run the above rule:

2023-02-01 13:53:45.100 86Z3GCJ4MF.com.noodlesoft.HazelHelper[1828] DEBUG: Ignoring event in directory /Users/dobby218-mailinglist/Library/CloudStorage/OneDrive-RobertB.Dunlap,AttorneyAtLaw/Clio/01 Client Folder/Matter Folder. Only need to check for changes 1 levels deep. Event is in directory 2 levels deep.

When I change Subfolder Depth to "0" or "2" it doesn't match when tested on the "Matter Folder."

Looking at the "Rule Status" it doesn't show the rule matched any folder.

Any thoughts or further information you might need?

Thank you for your time reading all this.
rober1y
 
Posts: 11
Joined: Fri Nov 11, 2016 12:02 pm

Re: Folder Structure Thu Feb 02, 2023 11:03 am • by Mr_Noodle
If you want Hazel to go into subfolders, you need a separate rule to tell it to do so. Check the manual for "subfolders" as there's a chapter dedicated to the topic.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Folder Structure Sun Feb 05, 2023 6:04 pm • by rober1y
I'm sorry, but I'm still lost. I read the information you suggested and added the following rule to my monitored folder (which is the "Office Management Folder" created automatically by my Office Management software when I open a file for a new client or a new matter for an existing client):

If Kind is Folder:

Run Rules on Folder Contents.

At best, I still only get the rules to operate in the Client Folders, not the Matter Folder(s) within the Client Folder. I've tried playing around with the "Subfolder Depth" condition, and when set to "0" the rule runs on the Client Folder, creating the folder structure I want, but not where I want it: the Matter Folder.

When I set Subfolder Depth to 1, nothing happens. I check the rule on the Client Folder.

I feel like I am missing a condition or an action. Should I add "Continue Matching Rules"? to the "Run Rules on Folder Contents"? Or should I make a condition where the Rule runs in a folder with a condition of "Subfile/folder count is not 0"?

This used to work, and you reminded me that there was a rule about Run Rules on Folder Contents, but I guess there was another rule or condition as well.
rober1y
 
Posts: 11
Joined: Fri Nov 11, 2016 12:02 pm

Re: Folder Structure Mon Feb 06, 2023 11:14 am • by Mr_Noodle
Can you post your full set of rules? The specifics including rule ordering matter here.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Folder Structure Mon Feb 06, 2023 3:58 pm • by rober1y
Recap:

-[Management Software Folder] (This is the folder monitored by Hazel)
--[Client Folder] - This folder is created by my Management Software and will have at least the following folder located within (if a repeat client, there could be more):
---[Matter Folder] (This folder is also created by my Management Software and where I want a standard set of folders created).

When a Matter Folder is created, I want Hazel to run an Automator Workflow/Action that creates a standard set of folders such as "correspondence folder," "Document Folder," "Notes Folder," etc.

The rules I have monitoring the [Management Software Folder" in order are as follows:

Rule 1. [Go into subfolders]

If all of the following conditions are met:
Kind is Folder

Do the following to the matched file or folder:
Run rules on folder contents

Rule 2. [Create Subfolder Structure]

If all of the following conditions are met:
Kind is Folder
Subfolder Depth is 0
Name does not start with untitled

Do the following to the matched file or folder:
Run Automator workflow: Create Client File Folders

This is the Automator workflow I use:

https://georgecoghill.wordpress.com/201 ... tor-hazel/

I have played around with Subfolder Depth, but the Rule doesn't match anything but 0.

Thanks again.
rober1y
 
Posts: 11
Joined: Fri Nov 11, 2016 12:02 pm

Re: Folder Structure Tue Feb 07, 2023 10:33 am • by Mr_Noodle
You have a problem with rule ordering. All folders will match the first rule so will not ever get to the second one. I suggest putting the subfolder rule at the end.

Also, I don't think you want subfolder depth 0. That would be in the monitored folder. You probably want depth 2.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Folder Structure Thu Feb 09, 2023 5:15 pm • by rober1y
It's working! The order of the rules must have been the key (and having the "Run Rules on Folder Contents"). I think what might have been happening is that, as written, the Rule was going through every folder in the monitored folder and running the Automator workflow installing the new folder structure. (I'm in the process of designing a rule to delete those newly created folders). Anyway, I think the main rule was clogging up the system with all the new folders so that the test folder never had the rule run on it.

To fix that, I added a condition only to run the rule when the subfolder count is "0". The Rule started working on my test folder then. Thank you for your time on this. I've learned a lot—the hard way.
rober1y
 
Posts: 11
Joined: Fri Nov 11, 2016 12:02 pm


Return to Open Discussion