Skip to main content
MRahnemun
Inspiring
October 9, 2018
Answered

If there is only one bookmark then I need to delete it.

  • October 9, 2018
  • 1 reply
  • 532 views

Hello,

I have a folder of files having over 8-10 thousand pdf file on it.... most of these files has only one bookmark on them but maybe around 1000 of them has multiple bookmark on them...

I need to split these files into separate file using top level bookmarks. Problem/bug that Adobe Pro split function has, is that for all those files with one book mark it creates duplicate file for it.... i.e. there is a file called A.pdf with one single bookmark on it called BM.  Now when I ran the Split function to split it using top level bookmark, it creates another file called A_Part1.pdf in the same folder now in the same folder I have two identical file called A.pdf & A_Part1.pdf.  I do not need duplicate file with two different name.  I need to stop this duplication of file... if there is only one Bookmark then splitting operation should be skipped so I only have one file in the folder called A.pdf or if it creates A_Part1.pdf then it should delete the original file if there are no pages/zero left on the Original file.

Can Adobe fix this bug or somebody help me to over come this dilemma?

Regards,

MR...

This topic has been closed for replies.
Correct answer try67

You can use this code to do it:

if (this.bookmarkRoot.children!=null && this.bookmarkRoot.children.length==1)

    this.bookmarkRoot.children[0].remove();

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 11, 2018

You can use this code to do it:

if (this.bookmarkRoot.children!=null && this.bookmarkRoot.children.length==1)

    this.bookmarkRoot.children[0].remove();