I'm trying to search for the word Chapter on a Contents page and add the word to the note contents. The script below works fine. I would like to get the next word after "Chapter" so I end up with "Chapter 1", "Chapter 2" and so forth. There has got to be a way to get the next word and add it to the "Chapter". I just can't get it to work. Any suggestions or tips would be most helpful.
/*
var numWords = this.getPageNumWords(2);
for (var i = 0; i < numWords; i++)
{
var myWord = this.getPageNthWord(2, i);
if (myWord == "Chapter")
{
this.addAnnot({
page: 2,
type: "Underline",
quads: this.getPageNthWordQuads(2, i),
contents: myWord
});
}
}
*/
I thought I could get the word next to the word "Chapter" by using the following line of code but it doesn't seem to work and I'm not sure what I am doing wrong.
//this.getPageNthWord(2, (i + 1);
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com