I have two frames of texts linked on one page. But during an iteration by using everyitem() he chooses the second before the first?


Salvation by the Expert


I have two frames of texts linked on one page. But during a iteration using everyitem() he chooses the second before the first?

var ObjDoc = app.activeDocument;
var LstPara is ObjDoc.pages.everyItem ().textFrames.everyItem ().paragraphs.everyItem () .getElements ();.

for (c1 var = 0; c1 < LstPara.length; ++ c1)
{
by var = [c1] LstPara;
$.writeln (par.contents.toString ());
}


is there a specific reason for this? Please explain

To solve your problem, try the following code:


var ObjDoc = app.activeDocument;
var LstTxtFrame = ObjDoc.pages.everyItem().textFrames.everyItem().getElements();

for(var c1=LstTxtFrame.length-1;c1>=0;c1--)
{
    var LstPara = LstTxtFrame[c1].paragraphs.everyItem().getElements();
    for(var c2=0;c2

I have two frames of texts linked on one page. But during a iteration using everyitem() he chooses the second before the first?

is there a specific reason for this? Please explain

Text blocks InDesign will work in LIFO method (last in first out), that is, the last image of text created will be treated as a first picture of the loop, so try the above code.

Vandy

Tags: InDesign

Similar Questions

Maybe you are looking for

  • How to remove a folder from photo?

    How to remove a folder from photo?

  • BIOS password problem

    Hello I had a password on my BIOS, and I know because I was the one who set it. Later, as I was going to sell I need to remove this password, so after I removed it, it always appears with a password screen to enter the bios (I can get the operating s

  • ThinkPad edge E530 to Win 8 pro upgrade failed

    I tried to update my E530 to Windows 8, but the installation stops at 29%, any help?

  • Help... I need to install a drive on my desktop

    I need to install a drive on my desktop. But when you try to run the .exe file, it says: is not a valid win32 application. How do you get the app on your desktop, if it is not the latest version?

  • Sort of a listfield

    Hello.. I display a listfield of names in the address book... I use vector for holding data from address book... Vector objects contains the following data... Title First name Family name Contact No. I'm adding contacts to the listfield. but I want t