Generate script