I am having bulk of books in a folder to be bookmarked (Standarad Bookmarks). I have a javascript code to create bookmarks and run using batch processing. What are the standard procedures to execute a js without batch process?
I am having bulk of books in a folder to be bookmarked (Standarad Bookmarks). I have a javascript code to create bookmarks and run using batch processing. What are the standard procedures to execute a js without batch process?
// Document-level or folder-level JavaScript.
function searchBookmarks(bkm, nLevel, bkmName)
{
if ( bkm.name == bkmName ) return bkm;
if (bkm.children != null) {
for (var i = 0; i < bkm.children.length; i++)
{
var bkMark = searchBookmarks(
bkm.children[i], nLevel + 1, bkmName);
if ( bkMark != null ) break;
}
return bkMark;
}
return null;
}
// Redefine this function for a more sophisticated compare.
function bmkCompare( name1, name2 )
{
return ( name1 == name2 );
}
The following code initiates the search. This code could be executed as field-level JavaScript or be executed as a menu action.
var bkmName = app.response({
cQuestion: "Enter the name of the bookmark to find",
cTitle: "Bookmark Search and Execute"
});
if ( bkmName != null ) {
var bkm = searchBookmarks(this.bookmarkRoot, 0, bkmName );
if ( bkm != null ) bkm.execute();
else app.alert("Bookmark not found");
}
Create a bookmark at the top of the bookmark panel that takes you to the next page in the document.
this.bookmarkRoot.createChild("Next Page", "this.pageNum++");
Attach an action to the topmost bookmark.
var bm = bookmarkRoot.children[0]
bm.setAction("app.beep(0);");
My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.