Select Objects by Multiple Materials?

I used ninjaripper to rip a map from a game, what it does is that I have to rip certain times and it creates many duplicated materials with the same name.
I would like to request a script that I can select objects by multiple materials so that I can apply one material on the objects I selected

for example:
http://img203.imageshack.us/img203/1772/20229927.png

Please help me! I have about 3500 textures and I can't really select one by one and merge the textures......I appreciated it a lot!!!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
brianuuu's picture

but some different textures

but some different textures have the same name but in different directory, if I put them all in the same folder some texture will be replaced!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.