How can I programmatically clear text selection in InDesign using ExtendScript?

I programmatically selected some text in InDesign using ExtendScript:

app.findGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.appliedFont = myFont;
var matches = app.activeDocument.findGrep();
if(matches.length > 0) {
  matches[0].select();
}

How can I deselect now? There is no function for this, for example, app.clearSelections();or something like that?

+3
source share
1 answer

Try:

app.activeDocument.select(NothingEnum.NOTHING);
+3
source

All Articles