roll-over image for result 
script Attach by Material
what it does
This scripts converts objects with the same material to a single object named after the spcific material.
action
download script