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

Select text from cursor position to end of story

Participant ,
Feb 23, 2010 Feb 23, 2010

Hi scripters

i want to cut, copy and paste text from cursor position to end of story in to new text frame?

how can i do this?

thanks in advance

regards

a r u l

TOPICS
Scripting
1.1K
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

correct answers 1 Correct answer

Engaged , Feb 23, 2010 Feb 23, 2010

Hi Arul,

Here is example for you. You can change the position and size of text box as per your requirement.

if (app.selection[0].constructor.name != "InsertionPoint")

{

exit();

}

var mypage = app.selection[0].parentTextFrames[0].parent;

app.select(app.selection[0].parentStory.insertionPoints.itemByRange (app.selection[0].index, app.selection[0].parentStory.characters[-1].index))

app.cut();

var tf = mypage.textFrames.add ({geometricBounds: [0,0,100,100]})

app.select(tf.insertionPoints[0])

app.paste();

Shonk

...
Translate
Engaged ,
Feb 23, 2010 Feb 23, 2010

Hi Arul,

Here is example for you. You can change the position and size of text box as per your requirement.

if (app.selection[0].constructor.name != "InsertionPoint")

{

exit();

}

var mypage = app.selection[0].parentTextFrames[0].parent;

app.select(app.selection[0].parentStory.insertionPoints.itemByRange (app.selection[0].index, app.selection[0].parentStory.characters[-1].index))

app.cut();

var tf = mypage.textFrames.add ({geometricBounds: [0,0,100,100]})

app.select(tf.insertionPoints[0])

app.paste();

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
Participant ,
Feb 23, 2010 Feb 23, 2010
LATEST

Thank you Shonky Great work

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