Answered
remove double space script
Hey there,
I am struggling with my code to get the GrepPreferences to apply to only the selected text Frames in Indesign. right now it applies to all text frames in document. I know it has to do with the app.changeGrep.
var myDoc = app.activeDocument;
var selection = app.selection[0];
var textChange = app.selection.textFrames;
var selectedFrames = [];
//make sure text frame selected
if(selection == null || !(selection instanceof TextFrame)) {
alert("Please select a text frame");
exit();
} else {
for(var i = 0; i <= selectedFrames.length; i++) {
//do something with each selected text frame
//reset field
app.findGrepPreferences = NothingEnum.nothing;
//change find what
app.findGrepPreferences.findWhat = " +";
//change to
app.changeGrepPreferences.changeTo = " ";
app.changeGrep();
}
}
Does anyone have any ideas?
