Rename by sub-subfolder-name

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

Moderator: Mr_Noodle

Rename by sub-subfolder-name Tue Dec 11, 2018 3:21 am • by speedy_99
The following combination of rules is working for „rename by subfolder-name“.
Is it possible to rename only by sub-subfolder-name?


Create a rule and give it name “Watch Subfolders”.
(found here: https://beebom.com/how-use-hazel-rules/)

1. rule
Set the condition to: Kind – is – Folder
Set the action to: Run rules on folder contents
Put that rule at the top.

2. rule (by Mr-Noodle)
If (all) are met
If extension is mkv
If (all) are met for (the enclosing folder)
Name matches (•folder name)
Do
Rename (•folder name)(extension)

thx Speedy
speedy_99
 
Posts: 56
Joined: Thu Feb 12, 2015 11:00 pm

Re: Rename by sub-subfolder-name Tue Dec 11, 2018 11:44 am • by Mr_Noodle
I'm not sure if I follow. Can you give me an example of a file going through your workflow?
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rename by sub-subfolder-name Tue Dec 11, 2018 2:05 pm • by speedy_99
Hi Mr_Noodle,

here my exampel:

I want to ren files by moving them to the "Sub-Subfolder"

"Root"-Folder\Subfolder_A\Sub-Subfolder_1 ...9

"Root"-Folder\Subfolder_B\Sub-Subfolder_1 ...9

"Root"-Folder\Subfolder_X\Sub-Subfolder_1 ...9

The "Subfolder_A ...X " stands for different organisation units in my office.
The "Sub-Subfolder_1 ...9" stands for different kinds of documents.

The ren follows the same conditions. So only one rule in "Root"-Folder" would manage all the "Sub-Subfolder_1 ...9" and it would not be nescessary to add a lot of folders to HAZEL.

I hope you could understand my bad english.
speedy_99
 
Posts: 56
Joined: Thu Feb 12, 2015 11:00 pm

Re: Rename by sub-subfolder-name Wed Dec 12, 2018 11:49 am • by Mr_Noodle
How do you determine which folder any particular file goes into?
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rename by sub-subfolder-name Wed Dec 12, 2018 7:30 pm • by speedy_99
I use manually drag and drop.

It's the intention to rename the files always in the same way. I use it for files wich could not be recognized by other rules.


Perhaps I found a way, I am testing “Subfolder depth” with “Subfolder depth is 2”
speedy_99
 
Posts: 56
Joined: Thu Feb 12, 2015 11:00 pm

Re: Rename by sub-subfolder-name Thu Dec 13, 2018 11:25 am • by Mr_Noodle
Which folder are you dropping them into? At some point, I'm guessing you want Hazel to automatically do something but I'm not clear on what part that is at this point.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rename by sub-subfolder-name Thu Dec 13, 2018 1:41 pm • by speedy_99
I am dropping files, no folders, in "sub-subfolder" and the the file is renamed by the sub-subfolder name.
But it should only work for this folder level!

A lot of documents I received are too variable for rules. So I want to drop the files in sub-subfolder.

For example:
One group of "sub-subfolders" are named by companies.
Second group, kind of documents (invoice, contract etc.)
Third group employees ...
speedy_99
 
Posts: 56
Joined: Thu Feb 12, 2015 11:00 pm

Re: Rename by sub-subfolder-name Fri Dec 14, 2018 10:14 am • by Mr_Noodle
Using sub-folder depth should work. Note that files/folders at the top level are at depth 0.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rename by sub-subfolder-name Mon Dec 17, 2018 7:32 am • by speedy_99
It works, but the renamed file will be renamed continiously again and again ...

Normally a rule stops after the work is done.
Is it differnt in this combination of conditions?
Is it possible to avoid this?
speedy_99
 
Posts: 56
Joined: Thu Feb 12, 2015 11:00 pm

Re: Rename by sub-subfolder-name Mon Dec 17, 2018 10:45 am • by Mr_Noodle
How do your rules look now?
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rename by sub-subfolder-name Mon Dec 17, 2018 2:59 pm • by speedy_99
1. rule:

"Go into subfolders"
If all Conditions
Kind is Folder

Do the following to the matched file or folder


2. rule:

If all Conditions ...
Kind is PDF
Subfolder Depth is 2


If all of the following conditions are met for its enclosing folder
Name matches ∙subfolder name

Do the following to the matched file or folder:
Rename with pattern: date created+++∙subfolder name




Is there an easier way to copy rules instead of typing them?
speedy_99
 
Posts: 56
Joined: Thu Feb 12, 2015 11:00 pm

Re: Rename by sub-subfolder-name Tue Dec 18, 2018 12:03 pm • by Mr_Noodle
You can post screenshots.

As for your PDF rule, if you only want this to happen when the file is first added, then add a condition like "Date added is after date last matched". That should make it so it only happens once.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support