Is there a script that will replace a shape with another shape?

 From:  Matadem
11945.1 
Good day.
I have about 50 squares that I need to replace with a square that is close to it in shape.
Is there a script for this?

Tnx!