Copy link to clipboard
Copied
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..
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
HI @M.Hasanain,
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
thanks so much suresh!
It works fine and better....
Here I wish to give you points.....
thanks..
shil....
Copy link to clipboard
Copied
Hi!
This is updated one :
//Relink Unlinked TextFrames in Pages
var myDoc = app.activeDocument;
for (var i = 0; i < myDoc.pages.length - 1; i++) {
var currentPage = myDoc.pages[i];
var nextPage = myDoc.pages[i + 1];
var currentTextFrame = currentPage.textFrames[0];
var nextTextFrame = nextPage.textFrames[0];
currentTextFrame.nextTextFrame = nextTextFrame;
}
Copy link to clipboard
Copied
HI @M.Hasanain,
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
Copy link to clipboard
Copied
@Manan Joshi
Thanks , i forget to examine it correctly , thank you for the correction