• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Is there a js command to open the bookmark tree in a collapsed state to only top level bookmarks?

New Here ,
Aug 02, 2019 Aug 02, 2019

Copy link to clipboard

Copied

My software makes hundreds of bookmarks in a hierarchy.  We want to open the bookmarks bar in a collapsed state showing only the first level bookmarks.  Is there a js - app.execMenuItem type command or any other to do this?

TOPICS
Acrobat SDK and JavaScript , Windows

Views

242

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 02, 2019 Aug 02, 2019

Copy link to clipboard

Copied

Found one answer although a bit awkward at Re: Expand/Collapse all the Bookmarks in a PDF file   in case anyone else is looking.  Tks.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 03, 2019 Aug 03, 2019

Copy link to clipboard

Copied

If you're going to use the code from that thread, use the one posted by gkaiseril, as this needs to be done recursively.

I've also written a small (paid-for) tool that does it with a single click, if you're interested: Custom-made Adobe Scripts: Acrobat -- Close/Open All Bookmarks

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 04, 2019 Aug 04, 2019

Copy link to clipboard

Copied

LATEST

This is script to expand bookmark:

this.pane = "bookmarks";

var myRoot = this.bookmarkRoot;

for (var i = 0; i < myRoot.children.length; i++)

{

   var child = myRoot.children;

   child.open=true;

}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines