Create a new bookmark under an existing bookmark in the tree
i have script search through time sheet report pages without string "employee signature" , create new bookmarks under existing bookmarks in tree.
so far script execute book marks pages in time sheet report without string "employee signature".
at last bookmark executed insert new child bookmark before following console error appears.
this.bookmarkroot.children[(m + 1)] undefined
19:console:exec
typeerror: this.bookmarkroot.children[(m + 1)] undefined
19:console:exec
of 128
if can please advise script going wrong appreciated. script follows:
var ckwords; // word pair test
var bfound = false; // logical status of found words
// loop through pages
for (var m = 0; m < this.numpages; m++ ) {
bfound = false; // set found flag false
numwords = this.getpagenumwords(m); // number of words on page
// loop through words on page
(var j = 0; j < numwords-1; j++) {
// word pair test
ckwords = this.getpagenthword(m, j) + ' ' + this.getpagenthword(m, j + 1); // test words
// check see if word pair 'employee signature' string present
if ( ckwords == "employee signature") {
bfound = true; // indicate found logical value
break; // no need further test page
} // end employee signature
} // end word loop
// test see if words not found
if(bfound == false) {
var nlastsub = this.bookmarkroot.children[(m+1)].children.length-1;
this.bookmarkroot.children[m+1].children[nlastsub].execute();
this.bookmarkroot.children[m+1].children[nlastsub].createchild("employee signature reqd", "this.pagenum = " + (m+1));
} // end not found on page
} // end page loop
thank you
why using variable ("m") points page number point bookmark? 2 not same, know...
More discussions in JavaScript
adobe
Comments
Post a Comment