Javascript - changing fill color of all text boxes in document
Hello,
I created several text boxes in a document and I was then asked to change the fill colour of all the boxes to a specific colour. I wanted to create an action since there are several documents that I need to go through. I'm new to javascript and I surmise that text boxes are technically numFields (I could be wrong). So I created the following codes (neither of which worked):
First One:
for ( var i = 0; i < this.numFields; i++) {
var field = this.getField(this.getNthFieldName(i));
if ( field.name.indexOf(this.getNthFieldName(i)) > -1 ) {
field.fillColor = color.green;
}
}
Second One:
for ( var i = 0; i < this.numFields; i++) {
var field = this.getField(this.getNthFieldName(i));
if (this.getField(this.getNthFieldName(i)).type == "text") {
field.fillColor = color.green;
}
}
Can anyone tell me what I'm doing wrong?
Thanks.
