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
Copy link to clipboard
Copied
Simply use .importStyles(). You can find the details in one of the object-model viewers.
P.
Copy link to clipboard
Copied
Hi pkahrel,
Thanks for the guidance.
Thanks,
Prabu G