compile script with copy