3 Replies Latest reply on Dec 18, 2008 8:48 AM by MarkWalsh

    Compare form fields for validation purposes.

      Is it possible in Acrobat Professional 7.1 or 8.1.3 for Mac to have a script (java or apple) that can compare form fields and validate that the data in each matches the other on two separate PDFs?

      For example, say I have a PDF that says the month in one field and another PDF that also contains the month in another field. I want to compare the two and if they don't match, give an error message or reset the fields, or something like that.
        • 1. Re: Compare form fields for validation purposes.
          MarkWalsh Level 4
          It should be possible with Javascript. You could set a variable to a reference to the second document, and retrieve the contents of it's fields from the first document. Then do your comparison.

          You will need the following line in the second PDF for the other one to recognize it

          this.disclosed = true;
          • 2. Re: Compare form fields for validation purposes.
            Level 1
            Thanks Mark. What I'm looking to make is an Applescript that can run in the background, match up files by an identifying string in the filename, open each file and compare the month fields. If the months are the same, it will move the files to another folder, if they are not matching, it will send an email back to the issuer (possibly with the file attached) and tell them they need to check their dates. So far I can get Acrobat to report the field contents to me in an alert message via a javascript installed in the Tools menu, however, when I try and bring the code out of Acrobat and into an applescript, I am running into problems. Script editor keeps telling me it can't understand my do script command. Below is the javascript I have, but I haven't a lot of experience with javascript much less implementing it with applescript. I know how to write my applescript to do all the moving of files and comparing of information once I get it out of javascript, I'm really looking just to figure out that portion. Any tips are greatly appreciated.

            app.addMenuItem({ cName: "Get Month 1", cParent:"Tools", cExec:" month()"});

            function month()

            var field = this.getField("Month 1 Pulldown");

            app.alert ({
            cMsg: (field.value)

            • 3. Re: Compare form fields for validation purposes.
              MarkWalsh Level 4
              Not sure if I can help you out too much, I use mostly Javascript with Acrobat. I have used Applescript to fill out forms with data in Filemaker, but it's much easier to put data into the form than pull data from it via applescript 'Do Script'.