var a = this.getTemplate("HS");
The script works fine, however, every time the button is pressed a duplicate template is created and so on. I'd like to find a way so that if the button is pressed more than once, either the previous template is removed or is replaced each time the button is pressed.
Thanks George. I was able to insert a simple if/else into the script to achieve this.
What would the method be for deleting a page if I wanted a button on the page to have an action which would delete the second page of the pdf?