Train and apply scripts.