Indesign - script to deal with overflow type

Hello,

Does anyone know if it is possible for a script to deal with text overflow in a Indesign doc, what i am looking for is the script to detect overflow and then adjust the type till it fits.