First thing why do you want to recompile the valid objects?

Which scripts are you using to recompile the objects?