I've run into a problem using the Automating Bookmark tutorial's script, which I'll post here:
function FindBookmarkByName(oBkMkParent,cFindName,nInc)
{
if(nInc == null)
nInc = [1];
else if(typeof(nInc) == "number")
nInc = [nInc];
var aBkMks = oBkMkParent.children;
var oRtn = null;
if(aBkMks != null)
{
for(var i=0;i
var aSchedNames = [ "....Choices in here...."];
var cRtn = app.popUpMenu.apply(app, aSchedNames);
if(cRtn != null)
{
app.execMenuItem("NewBookmark");
app.execMenuItem("NewBookmark");
var oBkMk = FindBookmarkByName(this.bookmarkRoot,"Untitled");
if(oBkMk != null)
oBkMk.name = cRtn;
var oBkMkEx = FindBookmarkByName(this.bookmarkRoot,"Untitled");
if(oBkMkEx != null)
oBkMkEx.remove();
}
The problem is that this runs successful only for a few bookmarks, then the bookmarks begin to be named Untitled. If I double click on Untitled then the name will change but that's an extra step that obviously was not part of the design. Any suggestions?
http://acrobatusers.com/tutorials/2008/10/auto_bookmark_creation