Codes work in ArcMAP Python window, but error when run as a script
The attached codes work in Arcmap python window when I copied and passed them line by line, but error in line 65 (arcpy.Project_management) and following (when I temporarily delete the Project tool then the error raise in AddField tool ) when I run it as a script. The error information is "
RuntimeError: Object: Error in executing tool
What is wrong with it?