Reply To: Create text frame from selected text in indesign

#81739
Peter Kahrel
Participant

What do you mean by ‘paste into the text field again’? That the frame becomes an inline? If what you select is on a single line, then the script below would do it. Select some text, all on one line, and run the script.

(function(){
  var width = app.selection[0].endHorizontalOffset - app.selection[0].horizontalOffset;
  var frame = app.selection[0].textFrames.add();
  app.selection[0].move (LocationOptions.AFTER, frame.insertionPoints[0]);
  var gb = frame.geometricBounds;
  gb[3] = gb[1]+width
  frame.geometricBounds = gb;
}());

Peter

This article was last modified on February 10, 2016

Comments (0)

Loading comments...