Has this command been updated for version 9:
app.execMenuItem("NewBookmark")
When I run the below javascript code Acrobat (v9) says there is an internal error.
I'm assuming the issue is "app.execMenuItem("NewBookmark")".
function brk(splitbm)
{
// * is the authors choice for the split character, you may change it
if (splitbm.name.indexOf('*') != -1)
split(splitbm);
//split if the bookmark name has the ^ charater
if (splitbm.children != null)
for (var i=0;i< splitbm.children.length;i++)
newbrk(splitbm.children[i]);
// split all the children bookmarks of mybm
}
function split(bm)
{
var bmname=bm.name;
var splitat=bmname.indexOf('*');
// The user can change the * , remember to change the previous function as well
var topname=bmname.substring(0,splitat);
var botname=bmname.substring(splitat+1,bmname.length);
var thisdoc=bm.doc;
bm.execute();
app.execMenuItem("NewBookmark");
var thisdoc=bm.doc;
var rootlen=thisdoc.bookmarkRoot.children.length;
var newbm=thisdoc.bookmarkRoot.children[rootlen-1];
newbm.name=botname;
bm.name=topname;
// make all [childbookmarks of mybm] newbm's children
if (bm.children != null)
{
var endpos=bm.children.length;
for(a=0;a
var menuItems = app.listMenuItems()
for( var i in menuItems)
console.println(menuItems[i] + "\n")
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com