script.jsscrapbox.PageMenu.addMenu({
title: 'GATHER HEADLINES',
image: 'https://gyazo.com/65231e54577a31f8b0c5411f0aa0a814/raw',
onClick: () => {
var headlines = [];
for (let line of scrapbox.Page.lines) {
if (!line.section.start) continue
var title = line.text
//title = title.replace( /\[([^\[\]]+)\.icon\]/g,"($1)");
//title = title.replace( /\[([^\[\]]+)\]/g,"$1");
const headline = title
headlines.push(headline)
}
if(navigator.clipboard){
navigator.clipboard.
writeText(headlines.join('\n'));
}
}
})