Acrobat and JavaScript

Recommended Posts

JLogan3o13 1,375

JLogan3o13 1,375

Just thought I would throw this out here, to see if anyone is intimately familiar with Acrobat scripting. I have a customer that wants a document level script to manipulate check boxes when the document is opened. I started out testing just one, and have tried the following two methods. The first assumes the document begins with the box checked, the second assumes it begins with the box unchecked.

var c1 = getField("CheckBox1");
c1.value = "Off"; //Unchecks the box

var f = this.getField("CheckBox1")
f.checkThisBox(0, true);

I have had two guys who do much more with Acrobat than I do tell me either should work. And indeed they do work if I create a button and assign the script to the button, just not when I create a document-level script. Just curious if anyone does a lot with doc level scripting in Acrobat, or has ever seen something like this.