Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Add page at end and link overflow text frame to last page

New Here ,
Feb 18, 2010 Feb 18, 2010

Hi,


I am writing a script to find if there is overflow text iin the selected text frame.

If it is overflowed, I need to add a page at end. This page should applied specific master page and the master page itself have text frames.


What I actually want is, the overflow text should be flown to the newly added page.


I wrote a simple script for doing this task. But the problem is, when the text is flown to new page, I am unable to select the text frame that is already present in that page (the text frame is already in master page). Because of this, the text is not flown to the new page.


My script is:


if (app.selection[0].overflows == true)  { 

    var pe = app.activeDocument.pages.add();

    var nextTextframe1 = mylastPage.masterPageItems[1];

    app.selection[0].nextTextFrame= nextTextframe1;

}

else  {

    alert ("Not Overflows");

}


Please suggest the solution for this.


Regards,

Gopal


TOPICS
Scripting
752
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 18, 2010 Feb 18, 2010

Hi Gopal,

This is working for me

if (app.selection[0].parentTextFrames[0].overflows == true)  { 

    var pe = app.activeDocument.pages.add();

    pe.masterPageItems[0].override(pe)

    app.selection[0].parentTextFrames[0].nextTextFrame = pe.textFrames[0];

}

else  {

    alert ("Not Overflows");

}

Shonky

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 18, 2010 Feb 18, 2010
LATEST

Thanks Shonky.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines