DeltaGen: renaming groups according to metadata

I've been trying to find a new method for renaming Groups according to the metadata contained in them:
1. Perform the rename on all the groups in a scene;
2. Find metadata categories in each group. Let's say the group has 3 Categories of metadata, with Data in all of them.
Category A: furniture
Catergoty B: chair
Category C: orange
3. Rename the group in order of metadata. Like "furniture - chair - orange"

Separately, I've been also looking for a way to renaming Shells according to the material assigned to them, for the sake of scene organization

I hope it makes sense
Cheers!