2 Replies Latest reply on Jan 30, 2017 7:30 AM by Ananth@desgin

    Find the same styles in two Documents

    Ananth@desgin Level 2

      Hi All,

       

      I am new in inDesign scripting, please tell me how to write a script to get same styles of paragraph and character styles in both of two InDesign documents. I am trying the script store the styles in one variable. Here is the code:

       

       

      var myDoc =app.documents[0];

      var myPstyle = app.documents[0].paragraphStyles.everyItem(0).getElements(0);

      alert(myPstyle.length)

      for(i=2; i<myPstyle.length; i++)

      {

          var newStyle = myPstyle[i].name;

          }

       

      var myDoc1 =app.documents[1];

      var myPstyle1 = app.documents[1].paragraphStyles.everyItem(1).getElements(1);

      alert(myPstyle1.length)

      for(i=2; i<myPstyle1.length; i++)

      {

          var format = myPstyle1[i].name;

          }

       

       

      Is this even possible?

       

      Thanks,

      Prabu G