sript to automate writing Codebook