Set the page destination of bookmarks
the script have search document (containing time sheets) looking pages not include text "employee signature"
the pages not contain text "employee signature" reported console (this part of script works)
the next part of script create bookmarks pages not have text "employee signature" , set page destination specific page.
the script create bookmarks, not set page destination correct page.
i have tried revising bookmark set destination javascript in different ways cannot work.
examples follows:
this.bookmarkroot.createchild("next page", this.pagenum = i+1);
book mark set action properties- javascript bookmark shows page number eg 61
this.bookmarkroot.createchild("next page", "this.pagenum = i+1");
book mark set action - javascript bookmark shows scripting , not go page number eg this.pagenum = i+1
the complete script shown below:
var ckwords; // word pair test
var bfound = false; // logical status of found words
// loop through pages
for (var = 0; < this.numpages; i++ ) {
bfound = false; // set found flag false
numwords = this.getpagenumwords(i); // number of words on page
// loop through words on page
(var j = 0; j < numwords-1; j++) {
// word pair test
ckwords = this.getpagenthword(i, j) + ' ' + this.getpagenthword(i, 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) {
console.println('pages not include employee signature: ' + (i + 1) +' ');
this.bookmarkroot.createchild("next page", this.pagenum = i+1);
} // end not found on page
} // end page loop
if can please me modify script set page destination bookmarks grateful.
try this:
this.bookmarkroot.createchild("next page", "this.pagenum = " + (i+1));
More discussions in JavaScript
adobe
Comments
Post a Comment