It helps if you actually ask a question so people know what you need help with.
I’m assuming they want to match the gray no material objects to the purple gemstone ones.
Select one of the purple gemstones. In the Materials panel, you should then see the material associated with the object. Select the gray objects, right click on the material and choose “Assign to objects”.
Ah, I see you asked for a macro:
! _-Properties _Pause
_Material _Match
_Pause _EnterEnd
Thank you so much,Sir.