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

Duplicate a paragraph in place

Community Expert ,
Nov 03, 2008 Nov 03, 2008
Hello All,

I have a paragraph with an anchored frame in it.

A paragraph with some text and a frame [frame].

I would like to duplicate this paragraph so there are two identical paragraphs together.

A paragraph with some text and a frame [frame].
A paragraph with some text and a frame [frame].

I tried using the duplicate method, but the closest I can get the duplicate is at the end of the story. Thank you very much.

Rick Quatro
rick at frameexpert dot com
585-659-8267
TOPICS
Scripting
443
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 ,
Nov 03, 2008 Nov 03, 2008
Which scripting language are you using? What code are you using to get the duplicate at the end of the story?

Dave
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
Community Expert ,
Nov 03, 2008 Nov 03, 2008
Sorry about that. CS3 and JavaScript. Here is my code:

var oPgf = app.selection[0].paragraphs[0];
oPgf.duplicate(LocationOptions.AFTER,oPgf.parent);

Rick
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 ,
Nov 03, 2008 Nov 03, 2008
This works for me:

var oPgf = app.selection[0].paragraphs[0];
oPgf.duplicate(LocationOptions.AFTER,oPgf);

Dave
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
Community Expert ,
Nov 03, 2008 Nov 03, 2008
LATEST
Hi Dave,

It works for me too! Thank you very much.

Rick
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