Copy link to clipboard
Copied
I'm using a script to apply a style that formats the text in an active document...such as the font style and size and it indents the first line of every paragraph.
When I run this script it only applies the style on the first paragraph and stops.
Here is the script:
var myDocument = app.activeDocument;
var myParagraphStyle = myDocument.paragraphStyles.item("My Paragraph Style");
myDocument.pages.item(0).textFrames.item(0).paragraphs.item(0).appliedParagraphStyle = myParagraphStyle;
Thank you in advance for any help on this.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi North,
Try this below JS Code.
var myDoc = app.activeDocument;
myDoc.pages[0].textFrames[0].paragraphs[0].appliedParagraphStyle = myDoc.paragraphStyles.itemByName("My P Style");
thx
csm_phil