Count files and rename based on result

HI,
I am trying to compare two directories based on the number of m4a files that the directories contain.
What I would like to do is for Hazel to go to each folder and count the number of m4a files the folder contains and then rename the folder based on current-name + no-of-m4a-files.
I want it to go through the folder structure doing this to all folders. There are a massive number of files and some have been renamed hence the count.
Any ideas on how this could be done.
I have been using to count the numbers but I don't think I can hand that result back to hazel as a variable.
any help appreciated.
Laurie
I am trying to compare two directories based on the number of m4a files that the directories contain.
What I would like to do is for Hazel to go to each folder and count the number of m4a files the folder contains and then rename the folder based on current-name + no-of-m4a-files.
I want it to go through the folder structure doing this to all folders. There are a massive number of files and some have been renamed hence the count.
Any ideas on how this could be done.
I have been using to count the numbers but I don't think I can hand that result back to hazel as a variable.
- Code: Select all
find /volume1/Audio | fgrep -c '.m4a'
any help appreciated.
Laurie