I need to automate the following manual steps:
Select all text in a text frame
Right-click a paragraph style
Choose Apply "style" then Next Style
Our designer has set up a complicated 'cascade' of next styles. So given a text frame variable in my script, how can I apply the paragraph style and get the same behavior of applying next styles? I tried the applyParagraphStyle method but couldn't get the next style applied for the following paragraphs.
Thanks for helping!
take this as a starting point:
var s = app.selection; var p = s.paragraphs; for (i = 1; i < p.length; i++ ) p[i].appliedParagraphStyle = p[i-1].appliedParagraphStyle.nextStyle;