Improved generation of analysis scripts