Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

apply paragraphStyles Inbetween paragraphStyles

$
0
0

Hi Forum,

 

this is the script im trying to change paragraphStyles[BodyText_Indent] of  paragraphsbetween "bullet" style and "bullet_2" style.

 

only one instance is happenningafter"bullet" style and before "bullet_2" style.

 

please help!...

 

 

 

myDoc = app.activeDocument;

for (j = myDoc.stories.length - 1; j >= 0; j--) {

    myStory = myDoc.stories.item(j);

    myParas = myStory.paragraphs;

//    if (myParas.length > 5) {

        for (i = 0; i <myStory.paragraphs.length;  i++) {

            if (myStory.paragraphs[i].appliedParagraphStyle == myDoc.paragraphStyleGroups.item("Bullet").paragraphStyles.item("Bulle t"))

                myStory.paragraphs[i+1].appliedParagraphStyle = myDoc.paragraphStyleGroups.item("Bullet").paragraphStyles.item("Bulle t_Indent")

               

                if (myStory.paragraphs[i].appliedParagraphStyle == myDoc.paragraphStyleGroups.item("Bullet").paragraphStyles.item("Bulle t_2"))

                myStory.paragraphs[i-1].appliedParagraphStyle = myDoc.paragraphStyleGroups.item("Bullet").paragraphStyles.item("Bulle t_Indent");

}}


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>