InDesign 脚本:访问应用了特定样式的实例
InDesign scripting: access instances that have specific style applied to
我对 InDesign 脚本编写还很陌生,想执行以下操作。
我的标题应用了一种称为 h2 的样式。我怎样才能得到所有这些实例的 collection 来进行操作?
谢谢。
var props = {
appliedParagraphStyle : "h2",
findWhat = ".+";
}
app.findGrepPreferences = null;
app.findGrepPreferences.properties = props;
var found = app.activeDocument.findGrep();
var n = found.length;
while (n--) {
//do something with instance n of found
//which is a text object
found[n].contents="Found you !";
}
我对 InDesign 脚本编写还很陌生,想执行以下操作。 我的标题应用了一种称为 h2 的样式。我怎样才能得到所有这些实例的 collection 来进行操作? 谢谢。
var props = {
appliedParagraphStyle : "h2",
findWhat = ".+";
}
app.findGrepPreferences = null;
app.findGrepPreferences.properties = props;
var found = app.activeDocument.findGrep();
var n = found.length;
while (n--) {
//do something with instance n of found
//which is a text object
found[n].contents="Found you !";
}