Shawn
Shawn

Reputation: 11391

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

I've 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 it now? Is there no function for this, like app.clearSelections(); or something of the sort?

Upvotes: 3

Views: 2135

Answers (1)

martinrohart
martinrohart

Reputation: 161

Try with:

app.activeDocument.select(NothingEnum.NOTHING);

Upvotes: 4

Related Questions