How to write a script