Page 1 of 1

How can I lowercase every file recursively in a folder?

PostPosted: Tue Sep 06, 2016 3:04 pm
by nikivi
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.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Wed Sep 07, 2016 8:31 am
by nikivi
Is there a way to do this? Or Hazel does not support recursive rules? :(

Re: How can I lowercase every file recursively in a folder?

PostPosted: Wed Sep 07, 2016 12:11 pm
by Mr_Noodle
See the sticky article about going into subfolders.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Wed Sep 07, 2016 4:06 pm
by nikivi
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.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Thu Sep 08, 2016 10:30 am
by Mr_Noodle
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.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Thu Sep 08, 2016 2:47 pm
by nikivi
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.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Fri Sep 09, 2016 12:07 pm
by Mr_Noodle
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.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Fri Sep 09, 2016 1:20 pm
by nikivi
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.

Re: How can I lowercase every file recursively in a folder?

PostPosted: Mon Sep 12, 2016 12:23 pm
by Mr_Noodle
"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.