Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Need a stop block in my script

$
0
0

Hi,

 

so lets include a function paraStepper():

 

app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = ":\\s*\r.";     // to match 2 paras - end & start 
var myDoc = app.activeDocument,
mFound = myDoc.findGrep(),
len = mFound.length, currPara; while (len--) {     currPara = mFound[len].paragraphs[0];     if (currPara.bulletsAndNumberingListType != ListType.BULLET_LIST){                    currPara = paraStepper(currPara);                    while (currPara) {                              currPara.words[0].characters[0].changecase(ChangecaseMode.UPPERCASE);                              currPara = paraStepper(currPara);                              }                    }     }
 function paraStepper (para){           var mRes = false,           story = para.parentStory,           next = story.paragraphs.nextItem(para);           if (next.isValid && next.bulletsAndNumberingListType == ListType.BULLET_LIST)                    mRes = next;          return mRes;           }
app.findGrepPreferences = app.changeGrepPreferences = null;

 

Jarek


Viewing all articles
Browse latest Browse all 37788

Trending Articles



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