Need a stop block in my script

Hi Forum,

I have been very useful to learn the vamitul and Jarek previous thread helps...

but still I'm late here and my mind blocked...

my script now to the content of the previous paragraph to find last character ': "if so, it will change all the paragraphs of balls first letter to ceilings...

It is what happens, convert all letters to paragraph ball caps...

So now the stop block is necessary to check, & stop change first bullet uppercase letter if the previous paragraphs end character is not equal to ":

var oDoc = app.activeDocument;

arr = [];

var myNextPara = oDoc.textFrames.everyItem () .getElements ();

for (k = 0; k < myNextPara.length; k ++) {}

myReturn = myNextPara [k].parentStory.paragraphs.firstItem (myNextPara [k] .paragraphs [0])

{if (myReturn.IsValid)}

If (myReturn.bulletsAndNumberingListType! == ListType.BULLET_LIST & &)

myReturn.lines.lastItem (). words.lastItem (). characters.lastItem (.silence) == ":" & & "."

myReturn.paragraphs.nextItem(myNextPara[k].paragraphs[0]).bulletsAndNumberingListType == ListType.BULLET_LIST)

{

changeCase();

}

If {myReturn.lines.lastItem (). words.lastItem (). characters.lastItem (.silence)! == ': ') {}

output

} } }

function changeCase() {}

app.findGrepPreferences.bulletsAndNumberingListType = ListType.BULLET_LIST;

app.findGrepPreferences.findWhat = "^ (\\l);

find = app.documents [0] .findGrep ();

for (i = 0; i < finds.length; i ++) {}

finds [i] = [i] finds .silence .silence [0] .toUpperCase ();

}}

Screen Shot 2013-08-22 at 14.14.44.png

Hello

so, lets include a paraStepper() function:

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

Tags: InDesign

Similar Questions

Maybe you are looking for

  • Problem of Ram MacPro 1.1 a1186

    I just upgraded my old mac pro with 16 GB of RAM FB 1.1 a1186 but only 8 GB are recognized. I tried different combinations in two editing maps, but the result is always the same 8 gb. Aries is a Hynix 8 GB (2x4gb) 240-pin DDR2-667 PC2-5300F ECC fully

  • Please help: billing is problem/unable to install free applications?

    I bought two apps a few days ago and never received a receipt for those bought as I had received with others. I don't know if this is all connected or relevant for other information before but when I try to install any application, even if it's free,

  • Update cumulative security for IE 8 for windows vista (KB978207)

    After you have installed the enemy of update cumulative security IE 8 for windows vista (KB978207) I found that my history of the internet, in the Favorites tab, for the past 2 weeks was erased someone ' one can confirm this has happened as a result

  • does not stay in the sleep

    My computer with Vista goes into sleep mode and then restarts; How to stay asleep?

  • Recovery XP system with new hardware

    Hello.  I have problems with a virus on my HP Media Center m1070n and I think to do a system recovery to get rid of him.  It has been really stubborn and nothing I've tried has been able to kill him.  I would go ahead and do the system recovery, but