Skip to main content
manuelb27477138
Inspiring
April 12, 2019
Answered

Clean Export Tagging Class in Paragrah Style Options

  • April 12, 2019
  • 1 reply
  • 893 views

Hello!

I try to clean the text box called Class in the Paragraph Style Options > Export Tagging:

I expect this result:

this is my code, but I can't not find the correct method here:

Adobe InDesign CS6 (8.0) Object Model JS: ParagraphStyle

var myDoc = app.activeDocument;

ParaStyle_Reduce();

//alert("Process Completed...");

function ParaStyle_Reduce(){

var countAllParagraphStyles = myDoc.allParagraphStyles.length; //simple counter to indicate the progress on Javascript console

for(var a=0;a<myDoc.allParagraphStyles.length;a++){

try{

// MENU PARAGRAPH STYLE OPTION - Advance Character Formats

myDoc.allParagraphStyles.includeCSSDefinition = false;

myDoc.allParagraphStyles.exportSelection = false;

$.writeln("Progress: " + a + " of " + countAllParagraphStyles + " Styles");  //simple counter to indicate the progress on Javascript console

}catch(e){}

}

}

Thanks so much!

This topic has been closed for replies.
Correct answer Manan Joshi

Hi Manan,

thanks for your time.

I run your script, but nothing happends. Is not working, and I don't get any error popup.

Please can you double check, or paste the full code.

Regards.


Hi Manuel,

The code snippet i shared was complete and works for me except for paragraphstyles which are in a group. For catering to styles in a group as well you can try the following code

var se = app.documents[0].allParagraphStyles

for(var i = 0; i < se.length; i++)

{

    for(var j = 0; j < se.styleExportTagMaps.length; j++)

    {

          if(se.styleExportTagMaps.exportType == "EPUB")

              se.styleExportTagMaps.exportClass = ""

    }

}

If it still does not work can you share some screenshots/sample Indesign document so that i can debug it better and fix it.

-Manan

1 reply

Community Expert
April 14, 2019

Try the following code, it will remove the class for all the paragraphstyles in the document

var se = app.documents[0].paragraphStyles.everyItem().styleExportTagMaps.everyItem().getElements()

while(a = se.shift())

{

    if(a.exportType == "EPUB")

          a.exportClass = ""

}

-Manan

-Manan
manuelb27477138
Inspiring
April 14, 2019

Hi Manan,

thanks for your time.

I run your script, but nothing happends. Is not working, and I don't get any error popup.

Please can you double check, or paste the full code.

Regards.