• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Find the same styles in two Documents

Engaged ,
Jan 26, 2017 Jan 26, 2017

Copy link to clipboard

Copied

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.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.name;

    }

Is this even possible?

Thanks,

Prabu G

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.
TOPICS
Scripting

Views

233

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 Expert ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

Simply use .importStyles(). You can find the details in one of the object-model viewers.

P.

Votes

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
Engaged ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

LATEST

Hi  pkahrel,

Thanks for the guidance.

Thanks,

Prabu G

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

Votes

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