Answered
Looking for a script to replace placeholder text in selected tablerows into numbering 1, 2, 3...
I was working with this script to replace placeholder text "###" in a text-selection into numbering. However this obviously won't work with text in selected tablerows. Anyone any ideas?
#target indesign
var
placeholder = "###",
mFound, len, start = 1;
if (app.selection[0] && (app.selection[0] instanceof "Text Frame" || app.selection[0].hasOwnProperty ("baseline") ) )
var mStory = app.selection[0].parentStory;
else { alert("Select target textFrame or some part of target text\rand try again!"); exit();}
app.findTextPreferences = null;
app.findTextPreferences.findWhat = placeholder;
mFound = mStory.findText();
len = mFound.length;
while (len-->0)
mFound[len].contents = (len + start).toString();
