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

谁都会走 提交于 2019-12-06 08:17:22

问题


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?


回答1:


Try with:

app.activeDocument.select(NothingEnum.NOTHING);


来源:https://stackoverflow.com/questions/10743073/how-can-i-programmatically-clear-text-selection-in-indesign-with-extendscript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!