Skip to main content
Inspiring
August 25, 2022
Answered

Paste text in a new text frame with styling intact (scripting)

  • August 25, 2022
  • 1 reply
  • 217 views

Hi

Is there a way to take a paragraph I've found via scripting and paste it in a new text frame but preserving it's style not just the contents?

thanks!

This topic has been closed for replies.
Correct answer brian_p_dts

Use myParagraph.duplicate()

var s = aNewFrame.parentStory;
myFoundGraph.duplicate(LocationOptions.AT_BEGINNING, s);

 

1 reply

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
August 25, 2022

Use myParagraph.duplicate()

var s = aNewFrame.parentStory;
myFoundGraph.duplicate(LocationOptions.AT_BEGINNING, s);