/* Create bookmarks for each page in the document */ var root = this.bookmarkRoot; try { for (var i = 0; i < this.numPages; i++) { root.createChild("Page " + (i+1), "this.pageNum=" + i, i); } } catch(e) { app.alert("Processing error: "+e) }