Copy link to clipboard
Copied
Hi everyone,
I've been searching for a little while to find a script or utility of some sort that will, essentially, create a style guide - of all styles present in a document - resulting in an InDesign document with a list of all styles applied, in the styles they represent.
I see a few here and there, but some are pretty old (2009!) and... I'll admit, I haven't created a script for ID before, so not sure what to do with the samples I've found.
Any guidance appreciated.
1 Correct answer
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 = makeD
...
Copy link to clipboard
Copied
Hi @turner111 , You can try this, which exports a .csv file with the style properties. In the current InDesign there are over 300 paragraph style properties:
https://shared-assets.adobe.com/link/a29d2554-8e5e-4e13-7bd1-8b3ec8e3e3ba
At the top of the script there is an array of properties to skip, which can be edited if you want to reduce the number of columns in the .csv. These are the properties that I’m omitting, but you could add more
var exceptions = ["styleUniqueId","emitCss","includeClass","paragraphKashidaWidth","designAxes","previewColor","rotateSingleByteCharacters","leadingModel","id","isValid","index","label","properties","styleExportTagMaps","parent","tabList","bulletChar","gridGyoudori","otfHVKana","leadingAki","tsume","kashidas","trailingAki","jidori","shataiMagnification","shataiDegreeAngle","shataiAdjustRotation","shataiAdjustTsume","tatechuyoko","tatechuyokoXOffset","tatechuyokoYOffset","kentenFillColor","kentenFont","kentenStrokeColor","kentenTint","kentenStrokeTint","kentenWeight","kentenOverprintFill","kentenOverprintStroke","kentenKind","kentenPlacement","kentenAlignment","kentenPosition","kentenFontStyle","kentenFontSize","kentenXScale","kentenYScale","kentenCustomCharacter","kentenCharacterSet","rubyFill","rubyFont","rubyStroke","rubyTint","rubyWeight","rubyOverprintFill","rubyOverprintStroke","rubyStrokeTint","rubyFontStyle","rubyFontSize","rubyOpenTypePro","rubyXScale","rubyYScale","rubyType","rubyAlignment","rubyPosition","rubyXOffset","rubyYOffset","rubyParentSpacing","rubyAutoAlign","rubyOverhang","rubyAutoScaling","rubyParentScalingPercent","rubyParentOverhangAmount","warichu","warichuSize","warichuLines","warichuLineSpacing","warichuAlignment","warichuCharsAfterBreak","warichuCharsBeforeBreak","cjkGridTracking","glyphForm","gridAlignFirstLineOnly","gridAlignment","autoTcy","autoTcyIncludeRoman","kinsokuSet","kinsokuType","kinsokuHangType","bunriKinshi","mojikumi","rensuuji","rubyAutoTcyDigit","rubyAutoTcyIncludeRoman","rubyAutoTcyAutoScale","treatIdeographicSpaceAsSpace","allowArbitraryHyphenation","paragraphGyoudori"]
Copy link to clipboard
Copied
Thanks Rob - really interesting! That said, I have to apologize - I should have been clearer in noting that I'm hoping to be able to generate the results within ID, using the styles being referenced. I've edited my original note.
Copy link to clipboard
Copied
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});
}
}
Copy link to clipboard
Copied
Are you looking for a Tree View based on BasedOn?
Copy link to clipboard
Copied
Thanks Robert - just did a search for that - didn't find anything.
Don't know what BasedOn is.
I'm just trying to create a style sheet.
Copy link to clipboard
Copied
BasedOn property is a reference to the "parent" style that current style inherits everything from - but changes only some properties - so when you build your structure of the styles properly - and you need to change a font - you just need to change the first style in the chain - not every style on the list.
Copy link to clipboard
Copied
So glad to find this thread. But I don't see the script that gives you the BasedOn spreadsheet.
Copy link to clipboard
Copied
Copy link to clipboard
Copied

