Hi,
If your sourceTextFrame is named "source"
and your outputTextFrame is named "output"
you can use it (or change the way of detecting text frames):
var mDoc = app.activeDocument;
var source = mDoc.textFrames.item("source"); // this name should be shown in "Layer" panel
var output = mDoc.textFrames.item("output"); // this name should be shown in "Layer" panel
var mLine, part1, part2; for (k = 0; k< source.parentStory.lines.length; k++) { mLine = source.parentStory.lines[k]; app.findGrepPreferences = null; app.findGrepPreferences.findWhat = "^.{4}"; part1 = mLine.findGrep(); app.findGrepPreferences.findWhat = "\\u(?=\\.)"; part2 = mLine.findGrep(); part1[0].duplicate(LocationOptions.AT_END, output.parentStory); part2[0].duplicate(LocationOptions.AT_END, output.parentStory); output.parentStory.insertionPoints[-1].contents = "_"; }
output.parentStory.characters[-1].remove();
output.parentStory.paragraphs[0].bulletsAndNumberingListType = ListType.NO_LIST;
rgds
Jarek