Export bookmarks as csv file

Apr 18, 2016

Copy link to clipboard

Copied

I have a script which exports bookmarks to a csv file.


The script actually works to a stage where the csv file is created and opened with the last book mark name being listed in the csv file.

All of the other bookmark names are not listed.

Some advise would be most appreciated in modifying the script to list all of the bookmarks in the csv file.

var bm = this.bookmarkRoot;

var ibmLength = bm.children.length;

for (var i = 0; i < ibmLength; i++)

var bookname = bm.children.name;

var fieldValues = [];

fieldValues.push(bookname);

this.createDataObject('output.csv', fieldValues.join());

this.exportDataObject({ cName:'output.csv', nLaunch:'2'});

thank you

You must use brackets for the for-loop:

var bm = this.bookmarkRoot;

var ibmLength = bm.children.length;

var fieldValues = [];

for (var i = 0; i < ibmLength; i++) {

  var bookname = bm.children.name;

  fieldValues.push(bookname);

}

this.createDataObject('output.csv', fieldValues.join());

this.exportDataObject({ cName:'output.csv', nLaunch:'2'});

TOPICS
Acrobat SDK and JavaScript

Views

1.1K

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

Export bookmarks as csv file

Apr 18, 2016

Copy link to clipboard

Copied

I have a script which exports bookmarks to a csv file.


The script actually works to a stage where the csv file is created and opened with the last book mark name being listed in the csv file.

All of the other bookmark names are not listed.

Some advise would be most appreciated in modifying the script to list all of the bookmarks in the csv file.

var bm = this.bookmarkRoot;

var ibmLength = bm.children.length;

for (var i = 0; i < ibmLength; i++)

var bookname = bm.children.name;

var fieldValues = [];

fieldValues.push(bookname);

this.createDataObject('output.csv', fieldValues.join());

this.exportDataObject({ cName:'output.csv', nLaunch:'2'});

thank you

You must use brackets for the for-loop:

var bm = this.bookmarkRoot;

var ibmLength = bm.children.length;

var fieldValues = [];

for (var i = 0; i < ibmLength; i++) {

  var bookname = bm.children.name;

  fieldValues.push(bookname);

}

this.createDataObject('output.csv', fieldValues.join());

this.exportDataObject({ cName:'output.csv', nLaunch:'2'});

TOPICS
Acrobat SDK and JavaScript

Views

1.1K

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
Apr 18, 2016 0
Apr 19, 2016

Copy link to clipboard

Copied

You must use brackets for the for-loop:

var bm = this.bookmarkRoot;

var ibmLength = bm.children.length;

var fieldValues = [];

for (var i = 0; i < ibmLength; i++) {

  var bookname = bm.children.name;

  fieldValues.push(bookname);

}

this.createDataObject('output.csv', fieldValues.join());

this.exportDataObject({ cName:'output.csv', nLaunch:'2'});

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...
Apr 19, 2016 0
Jo_2013 LATEST
Apr 19, 2016

Copy link to clipboard

Copied

Thank you very much Bernd.

The script is now functioning thanks for your help

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...
Apr 19, 2016 0