I have no experience with scripting, but I can maybe explain what the intented script should do:
- Select text, cut it. Ctrl + X after
- Make textbox (manually). Drag with mouse, if possible "toggle" the hold Alt function to draw same x,y valued box.
- Check if box is created then paste text inside it. Ctrl + V
Rough idea of what I could find on the forums so far:
app.selection.endHorizontalOffset - app.selection.horizontalOffset var textBox = app.selection.textFrames.add(); textBox.geometricBounds; app.select(ip, SelectionOptions.REPLACE_WITH); textBox.contents = app.paste();
My job requires to do this a tedious number of times, possibly leading to repetitive strain injury.