how to write a calling script