I have a report with over 100 main bookmarks which will be generated each week.
Each bookmark contains sub bookmarks in the tree which needs to be removed.
Persons Name and Employee Number - (Main Bookmark)
Job Number 1 (Sub bookmark)
Job Number 2 (Sub bookmark)
I have a script to remove the sub bookmarks but it is not working.
Can anyone please provide assistance with modifying the script so it will remove the sub bookmarks?
function RemoveBookmark(bkm, nLevel)
for (var i = 0; i < bkm.children.length; i++)
You don't need recursion here. Try this:
for (var i=0; i < this.bookmarkRoot.children.length; i++)
for (var j=this.bookmarkRoot.children[i].children.length-1; j >= 0; j--)
Be aware that you might not see the results immediately. Try saving the file and then re-opening it afterwards.
Thank you very much for your assistance.
The script removes all of the sub bookmarks from the bookmark tree, excellent result.
Appreciate your help.