How can I lowercase every file recursively in a folder?

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

Moderator: Mr_Noodle

I would like to lowercase every file that I have in a folder. This folder also has other folders, I want to lowercase every file in these folders too. How can I do that?

I tried coming up with a rule for it but I am stuck.

Thank you for any help.
nikivi
 
Posts: 39
Joined: Tue Mar 08, 2016 10:04 am

Is there a way to do this? Or Hazel does not support recursive rules? :(
nikivi
 
Posts: 39
Joined: Tue Mar 08, 2016 10:04 am

See the sticky article about going into subfolders.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you. I got it somewhat working now but it does not match all the files. I have this rule :

Image

but when I have it run, it does not match all the files :

Image

'Hello.txt' should be 'hello.txt' but it isn't.

U suppose I can as per the guide, add another rule to for the folder specifically for text files. But shouldn't my 'Any File' condition take care of what I want for me (that is lowercase all files and folders recursively in the folder and remove extensions.

Can I just match 'any type'? This would be very nice.

Thank you for any help.
nikivi
 
Posts: 39
Joined: Tue Mar 08, 2016 10:04 am

Read the article again. You're rule resembles the example with a big red x on it (meaning, don't do this). Do not combine the rule there with your other logic. Try it again, using separate rules.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Read the article again. You're rule resembles the example with a big red x on it (meaning, don't do this). Do not combine the rule there with your other logic. Try it again, using separate rules.


I have a rule that recursively lowercases all folders and it works great.

Now I want to create a separate rule that lowercases all other non folder files. There seems to be no option there to 'Run rules on folder contents' when I create a rule that matches 'Any File' condition.

What should I do? I have read the article a few times and am still confused.

Thank you for any help.
nikivi
 
Posts: 39
Joined: Tue Mar 08, 2016 10:04 am

First, write your rules without the recursive part. Basically, the rules you have should work for things at the top level folder. Once that stuff is working, add the recursive rule, keeping in mind the ordering of the rules. Use the status interface (the "eye" button) to check your work.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:First, write your rules without the recursive part. Basically, the rules you have should work for things at the top level folder. Once that stuff is working, add the recursive rule, keeping in mind the ordering of the rules. Use the status interface (the "eye" button) to check your work.


But you can still not recursively change non folder items it seems. I have these three rules : https://i.imgur.com/OOdi8bt.png

Where first one takes care of top level files as you said : https://i.imgur.com/yzKHDtd.png

The second recursively changes folders and it works : https://i.imgur.com/CSKX5ZF.png

But what is the rule that I need to add so that I change all the files in the subfolders of my my main folder to lowercase too?

There is no option to match 'Any File' in there as I said. Perhaps I don't quite understand what you mean.
nikivi
 
Posts: 39
Joined: Tue Mar 08, 2016 10:04 am

"Any file" matches everything, including folders. Note that folders and files in general are not treated differently in terms of rule conditions. So, in this case, everything is matching the first rule and never getting to the second one. Try moving the folder one to the top.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support