Copy link to clipboard
Copied
Can you tell me how to edit this script to generate the new number upon printing? Currently it changes on saving and opening.
var f = this.getField("Tracking Number");if (f.value=="") f.value = "0001";else f.value = util.printf("%04d", (Number(f.value)+1));
Thank you!
Copy link to clipboard
Copied
Move the code to the Will Print event of the document, under Tools - JavaScript - Set Document Actions.