Script to change current template

Hi Guys,

Is it possible to write a script that will change the template of the current chart?

If there is I wanted to write a script that would run through all open chart and and change the template at once. I know I could use a template but would prefer to use a script.

Regards
Steve