How to use the sub-file count in actions?

Hello there.
As far as I researched, there is no native way of getting the sub-file count of a folder being analyzed by Hazel to use it in actions like Rename or Add Comment.
Can anyone help me sorting this? Shell script would be easy, but as per Hazel's documentation it can't return any value to be used. Maybe AppleScript? Unfortunately I'm illiterate on it.
Any help is appreciated.
As far as I researched, there is no native way of getting the sub-file count of a folder being analyzed by Hazel to use it in actions like Rename or Add Comment.
Can anyone help me sorting this? Shell script would be easy, but as per Hazel's documentation it can't return any value to be used. Maybe AppleScript? Unfortunately I'm illiterate on it.
Any help is appreciated.