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

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

134

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

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

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

135

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
Aug 02, 2019 0
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
Reply
Loading...
Aug 02, 2019 0
Most Valuable Participant ,
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
Reply
Loading...
Aug 03, 2019 0
Enthusiast ,
Aug 04, 2019

Copy link to clipboard

Copied

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
Reply
Loading...
Aug 04, 2019 0