Copy link to clipboard
Copied
Hello experts,
I have an exhibit stamp with an auto-incrementing letter. I want to store the values entered in the fields for stamp "A", so that if the user applies the stamp again, they can get a new stamp without appearing and having to enter values in the prompting boxes for stamp "B". Specifically, the city and name fields should always be the same for the sequence.
For example, if the "A" stamp is for "New York", then stamps "B", "C", "D", and so on up to "ZZ" should also be for "New York". The same should apply for the "Name" field.
However, the auto-incrementing letter should update.
I have an additional script in notepad that saves field values but not updating increment letters.
The stamp is attached!
Thank You
Copy link to clipboard
Copied
Hi,
Change your script with:
...
var lastLetter = this.getField("Letter").value;
if (lastLetter=="") {
// Prompt the user for input and set the values of the additional text fields
var data1 = app.response("Enter Name of Person:");
this.getField("Name").value = data1;
var data2 = app.response("Enter City (default: Vancouver):") || "Vancouver";
this.getField("City").value = data2;
}
// Reset the values of the "Month" and "Year" fields to empty strings
...
You should also modify it to only be able to enter a valid date.
@+
Copy link to clipboard
Copied
If you want the dynamic information on the stamp to be stable, then you'll need to use an automation script to set these values and store them in a global location before the stamp is applied. Trying to store values on the stamp file itself is problematic for a couple if reasons. First, because Acrobat manages the stamp files while stamps are being applied. There is no guarentee that any value will be saved as you'd like it too. But you also don't have a way to easily reset the process. An automation tool solves all these issues.
You would also benefit greatly from a custom dialog. Here's a tool that will help you build one.
https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm
Find more inspiration, events, and resources on the new Adobe Community
Explore Now