got this little script
mats = bpy.data.materials
for obj in bpy.context.selected_objects:
for slt in obj.material_slots: part = slt.name.rpartition('.') if part.isnumeric() and part in mats: slt.material = mats.get(part)
but does not seem to work
I still have mat with same name but different index
anyone has a working simple addon for the selected object ?