Script Help: Select All Objects that have a Multi-Sub Object Material

Im interesting in finding or developing a script that will allow me to select all scene objects that have a multisub object material.

i deal mainly with importing sketchup files into 3ds max, and there is a problem where identical edit meshes, lets say windows, come in with the same MSO material (say glass in MatID 1 and Metal in MatID 2) but the MSO material has a different name.

So, what i would like to have the script do is:

1. Select all objects in the scene that have multisub object materials.

2. Sort and condense the MSO objects based on the Material ID and the names of the materials in that ID.

Anyone have ideas?

Thanks.