Skip to main content
Known Participant
May 21, 2013
Answered

link textFrames

  • May 21, 2013
  • 1 reply
  • 1208 views

Hi Forum,

I have a small bit to link Text Frame between two pages....

var myDoc = app.activeDocument;

myDoc.pages[0].textFrames[0].nextTextFrame = myDoc.pages[1].textFrames[0];

but my intention is to link all the textFrames inside the document (total pages is 20 pages and each pages have textFrames unlinked to other pages).

Any possibilities.

thanks & regareds.

S..

This topic has been closed for replies.
Correct answer Manan Joshi

HI @M.Hasanin,

The original code should not have anything failing due to the InDesign version. The only issue I see is the missing array index on the left hand side of the assignement and that may have been due to the forum software migration. The following code should work and is almost the same as the original answer

var myDoc = app.activeDocument
for(var i=0; i < myDoc.pages.length - 1; i++)
    myDoc.pages[i].textFrames[0].nextTextFrame = myDoc.pages[i+1].textFrames[0];

-Manan

1 reply

SureshRaji
Inspiring
May 21, 2013

Hi Shilpa

You can do it by using the loop,

for(i=0; i<myDoc.pages.length-1;i++){

myDoc.pages.textFrames[0].nextTextFrame = myDoc.pages[i+1].textFrames[0];}

Suresh

shilpa25Author
Known Participant
May 21, 2013

thanks so much suresh!

It works fine and better....

Here I wish to give you points.....

thanks..

shil....