I need "simple" script for Multisub-Object. Can you help me? =)

Hello,
unfortunately, I’m not a scripter.
I need a script to copy the Name to Sub-Material name (all material or selected)
If you have a 3 sub-object material it’s easy.
But, if you have 30-40 sub-object material is a very time consuming.
Thanks so much!

=)