Rewrote applying scripts for batch (calling from another script)