Scripts for producing and managing documents