Exporting/Printing Character and Paragraph Styles List

Community Beginner ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

I have searched for a simple answer to this, or at least an active script to install with little success. CreativePro had an article answering this issue, but it was for much older vs. of ID in addition, the scripts are outdated, or no longer available to download. 

 

Issue: I have many styles I need to create a Style Guide/User guide for other future users. And before you say, "they can download them, import them from the cloud..." not so in my case. As these users are not Cloud/network connected. We have dedicated systems for internal use only. 

 

Can anyone please offer a solution, script... solution? Thank you my community of most talented designers. 

TOPICS
How to, Import and export, Print

Views

168

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
community guidelines
Adobe Community Professional ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

What is the link for the Creative Pro Network article? Do you know who wrote the script?

 

~ Jane

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
community guidelines
Community Beginner ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

No, I'm afraid I don't know who wrote the script, but this is the original article... https://creativepro.com/print-out-style-sheet-specs/  and there were a few others I tried tracking down as well as some old forums, but I would get a 404. 

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
community guidelines
Adobe Community Professional ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

@SusanL I was able to download the .zip file based on this link TextStylesReporterCS2 from the archived site and extract it locally on my computer. There are .inds and .jsx files included but I can't attach those file formats here. The PDF that was included is attached though. I can put the other files in a Dropbox folder for direct download if you like. They might be helpful as a starting point for someone in updating the script? Let me know if that would be of any 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
community guidelines
Community Beginner ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Thank you, I will look this over. I can't access dropbox, on my work (pain-n-the-butt) machine. Let me see if I can figure this out though. Thank you for taking the time to reply and troubleshoot as well.

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
community guidelines
Adobe Community Professional ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

No problem. Here is the .jsx file as a .txt file. Just change the extension back to .jsx when needed. 

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
community guidelines
New Here ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Do you have the snippet file for the script? (the .inds) TIA.

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
community guidelines
New Here ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

The link for TextStylesReporter no longer works. A scripter by the name of Dave Saunders wrote the script back in 2005 or 2006.

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
community guidelines
Adobe Community Professional ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

I have a copy of it.

Mike Witherell

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
community guidelines
Adobe Community Professional ,
Nov 28, 2021 Nov 28, 2021

Copy link to clipboard

Copied

LATEST

Hi @SusanL , I could not get Dave’s CS2 script to work in newer versions of InDesign. You are welcome to try this script:

 

https://shared-assets.adobe.com/link/a29d2554-8e5e-4e13-7bd1-8b3ec8e3e3ba

 

It exports a .csv spreadsheet with the document’s paragraph styles’ values to your Desktop. The file is named styletable.csv. The current version of InDesign has 330 different Paragraph Style properties, so navigating a full spread sheet can be difficult.

 

My script skips around 100 of the properties (e.g. jidori, warichuSize, etc.). The exceptions are listed at the top of the script and can be edited. It will also only report some properties if one of the styles uses them (e.g. ruleAbove, underline, etc.).

 

Here is the code from the jsx file I linked to above:

 

 

/*
* Export Paragraph Style Property List
* Version 1.0
* Rob Day 2020-2021
*/

//Properties to skip
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","rubyAutoTcyDigits",
                 "rubyAutoTcyIncludeRoman","rubyAutoTcyAutoScale","treatIdeographicSpaceAsSpace",
                 "allowArbitraryHyphenation","paragraphGyoudori"]
                 
            

//Skip these properties if all of the document’s properties are set to false
var ruleabove = false;
var rulebelow = false;
var uline = false;
var strike = false;
var parborder = false;
var parshade = false;

//the spreadsheet is saved to the dsktop
var path = Folder.desktop + "/styletable.csv";

//the document paragraph styles
var ps = app.activeDocument.paragraphStyles

//get the properties of basic paragraph style
var bps = ps[1];
var props = bps.reflect.properties;

//set the exception group 
flagExceptions();

//add exceptions
var exceptionsList = addExceptions(props);

//the table head (style properties)
var tbl = getProperties(props)
tbl += "\r";

//add the value lines
for (var i = 1; i < ps.length; i++){
    var vLine = getValues(props, ps[i]);
    tbl += vLine;
    tbl += "\r";
};   

//write the .cvs file
writeText(path, tbl)

/**
* get the property values as a tab delimited string
* @param array of properties
* @param the para style to get 
* @return tab delimited string of values for the table 
*/
function getValues(props, ps){
var ot, val, pn;
var vArray = [];

    for (var i = 0; i < props.length-5; i++){
        //the property as a string
        pn = props[i].name;
        //skip the exceptions
        if (!checkItem(exceptionsList, pn)) {
            //the value list
            ot = ps[props[i]]
            try {
                //if the value returns as an object get its name (e.g, a character style) else get it as a string
                if (typeof ot == "object") {
                    try {
                        if (ps[props[i]].name == undefined) {
                            val = ot.toString();
                        } else {
                            val = ps[props[i]].name;
                        }
                    }catch(e) {
                        val = ot.toString();
                    }
                } 
                //if it’s not an object get it as a string
                if (typeof ot != "object") {
                    val = ps[props[i]].toString();
                }
                //string fixes:
                //get a string list of tab stops
                if (pn == "tabStops") {
                   val = getTabs(ps.tabStops);
                } 
                //gets the number of nested styles
                if (pn == "nestedStyles") {
                    val = getNested(ps.nestedStyles.length);
                } 
                if (pn == "nestedLineStyles") {
                    val = getNested(ps.nestedLineStyles.length);
                } 
                if (pn == "nestedGrepStyles") {
                    val = getNested(ps.nestedGrepStyles.length);
                } 
                if (pn == "numberingRestartPolicies") {
                   val = ps.numberingRestartPolicies.numberingPolicy.toString();
                }
            
                //change -1 to 100% Tint
                if ((pn.substring(pn.length-4) == "Tint") && (val == "-1")){
                    val = "100"
                } 
                //remove tabs and commas from the value strings
                //for when the array is converted to a tab delimited string
                //replaces tabs in font names with hyphens
                val = val.replace(/(\t)/, '-');
                //replaces commas with spaces
                val = val.replace(/,/g, '')
                vArray.push(val)
            }catch(e) {} 
        }
    }
$.writeln(vArray.length)
    return vArray.toString().replace(/,/g, '\t');
}

/**
* Gets all of the basic paragraph’s properties that are not in the exception list 
* @param an array of all properties 
* @return an tab delimited string of properties
*/
function getProperties(props){
    var propArray = [];
    for (var i = 0; i < props.length-5; i++){
        if (!checkItem(exceptionsList, props[i].name)) {
            propArray.push(props[i].name)
        }
    }
    return propArray.toString().replace(/,/g, '\t') 
}

/**
* Set flags for additional style exceptions
* @return void 
*/
function flagExceptions(){
    var ps = app.activeDocument.paragraphStyles
    for (var i = 0; i < ps.length; i++){
        if (ps[i].ruleAbove == true) {
            ruleabove = true
        } 
        if (ps[i].ruleBelow == true) {
            rulebelow = true
        } 
        if (ps[i].underline == true) {
            uline = true
        } 
        if (ps[i].strikeThru == true) {
            strike = true
        }
        if (ps[i].paragraphBorderOn == true) {
            parborder = true
        }    
        if (ps[i].paragraphShadingOn == true) {
            parshade = true
        }           
    };   
}


/**
* Add exceptions to the global list 
* @param a array of properties
* @return new array of exceptions
* 
*/
function addExceptions(a){
    var pn;
    for (var i = 0; i < a.length-5; i++) {
        pn = a[i].name;
        
        if ((!ruleabove) && (pn != "ruleAbove") && (pn.substring(0,9) == "ruleAbove")) {
            exceptions.push(pn)
        }
        if ((!rulebelow) && (pn != "ruleBelow") && (pn.substring(0,9) == "ruleBelow")) {
            exceptions.push(pn)
        }    
        if ((!uline) && (pn != "underline") && (pn.substring(0,9) == "underline")) {
            exceptions.push(pn)
        } 
        if ((!strike) && (pn != "strikeThru") && (pn.substring(0,9) == "strikeThr")) {
            exceptions.push(pn)
        }  
        if ((!parborder) && (pn != "paragraphBorderOn") && (pn.substring(0,10) == "paragraphB")) {
            exceptions.push(pn)
            exceptions.push("mergeConsecutiveParaBorders")
        }  
        if ((!parshade) && (pn != "paragraphShadingOn") && (pn.substring(0,10) == "paragraphS")) {
            exceptions.push(pn)
        }    
    }
    return exceptions
}

/**
* Gets a string listing of tabs 
* @param the tabs array 
* @return tab string
*/
function getTabs(o){
    var s="";
    for (var i = 0; i < o.length; i++){
        s += o[i].position.toFixed(3) + "  "
    };   
    return s
}

/**
* Gets the number of nested styles in use
* @param the nested array length 
* @return value 
*/
function getNested(l){
    var s;
    if (l == 0) {
        s = "None"
    } else {s = l.toString()}
    return s
}

/**
* Checks if an item is in an array
* @param the array to check 
* @param the item to look for 
* @return true if the item is in the array 
*/
function checkItem(a, obj) {
    for (var i = 0; i < a.length; i++) {
        if (a[i] === obj) {
            return true;
        }
    }
    return false;
}

/**
* Write a text file 
* @param the file path 
* @param the text 
*/
function writeText(p,s){
    var file = new File(p);
    file.encoding = 'UTF-8';
    file.open('w');
    file.write(s);
    file.close();
}

 

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
community guidelines