I have no experience with scripting, but I can maybe explain what the intented script should do:
- Select text, cut it. Ctrl + X after
mouseUp
. - 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[0].endHorizontalOffset - app.selection[0].horizontalOffset
var textBox = app.selection[0].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.