Skip to main content
Jo_2013
Known Participant
April 19, 2016
解決済み

Export bookmarks as csv file

  • April 19, 2016
  • 返信数 1.
  • 9670 ビュー

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

このトピックへの返信は締め切られました。
解決に役立った回答 Bernd Alheit

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'});

返信数 1

Bernd Alheit
Community Expert
Bernd AlheitCommunity Expert解決!
Community Expert
April 19, 2016

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'});

Jo_2013
Jo_2013作成者
Known Participant
April 19, 2016

Thank you very much Bernd.

The script is now functioning thanks for your help