generate script file