If @Nick Passmore’s AS doesn’t work for you, have the document you want to get the list from active and try this JS:
/*
* Make a new document with a list of styled paragraph styles from the active document
* Rob Day 2020-2023
*/
app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES;
var d = app.activeDocument;
var dn = d.name.replace(/\.[^\.]+$/, '') + " Paragraph Styles";
var currdate = new Date
var ct = "Temp-" + currdate.getTime();
//makes the style list document
var dp = makeDocPreset(ct);
dp.properties = {facingPages:true, pageHeight:11, pageWidth:8.5, pageOrientation:PageOrientation.PORTRAIT, top:.75, bottom:1, left:.75, right:.75, createPrimaryTextFrame:true}
var sdoc = app.documents.add(true, dp);
sdoc.name = dn;
//enable smart textflow for long lists
sdoc.textPreferences.properties = {smartTextReflow:true, smartTextReflowSync:true, limitToMasterTextFrames:true, deleteEmptyPages:true};
dp.remove();
//imports the sytles into the new doc
var spDoc =app.documents[1];
var fp = spDoc.fullName
sdoc.importStyles(ImportFormat.PARAGRAPH_STYLES_FORMAT, File(fp));
//make the list
var ts = sdoc.pages[0].textFrames[0].parentStory;
var ps = sdoc.allParagraphStyles;
var sn
for (var i = 0; i < ps.length; i++){
sn = ps[i].name;
ts.insertionPoints[-1].contents = sn +"\r\r"
ts.paragraphs[ts.paragraphs.length-2].appliedParagraphStyle = ps[i];
};
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
/**
* Makes a new document preset
* @ param preset name name
* @ return the new preset
*/
function makeDocPreset(n){
if (app.documentPresets.itemByName(n).isValid) {
return app.documentPresets.itemByName(n);
} else {
return app.documentPresets.add({name:n});
}
}
