Reply To: Split text into separate non-threaded frames?

#55255

That sounds as if you started out real old style, cutting paper strips and pasting them with wax. I did that as well for some time. Does this script work for you? It's rigged to only cut on paragraph breaks, and only if the frame is not threaded to a previous one. It cuts right above the current paragraph; all you have to do is position your cursor somewhere after the paragraph you want to split off and run the script. For four separate frames, you have to “cut” three times — but then again, you can always assign a shortcut key to the script.

//DESCRIPTION:CopyCutter — Cut your Copy at the Cursor
// Jongware, 24-Mar-2010

if (app.selection.length == 1 && app.selection[0] instanceof InsertionPoint)
{
if (app.selection[0].parentTextFrames[0].previousTextFrame == null &&
app.selection[0].paragraphs.previousItem(app.selection[0].paragraphs[0]) != null)
{
oldframe = app.selection[0].parentTextFrames[0];
topline = app.selection[0].paragraphs[0].baseline;
newframe = oldframe.duplicate();
newframe.characters.itemByRange(app.selection[0].paragraphs[0].index – app.selection[0].parent.paragraphs[0].index-1, newframe.characters.lastItem().index).remove();
oldframe.paragraphs.itemByRange(oldframe.paragraphs[0], app.selection[0].paragraphs.previousItem(app.selection[0].paragraphs[0])).remove();
newframe.fit (FitOptions.FRAME_TO_CONTENT);
vdiff = topline – oldframe.characters[0].baseline;
newheight = oldframe.geometricBounds[2] – oldframe.geometricBounds[0] – vdiff;
oldframe.geometricBounds = [oldframe.geometricBounds[2] – newheight, oldframe.geometricBounds[1], oldframe.geometricBounds[2], oldframe.geometricBounds[3]];
}
}

This article was last modified on March 24, 2010

Comments (0)

Loading comments...