私は InDesign の JavaScript を書いています。これは GREP の検索/変更を行うものです。実際のところ、テキストを検索してスクリプト変数に保存する必要があるのは、grep が $2 の値で見つけたものです。スクリプトの他のすべての方法は知っています。今必要なのは、この 2 ドルを手に入れる方法を見つけることです
簡単な例:
app.findGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = "(\\d)+(\\d)";
found = app.activeDocument.findGrep();
...
found[0].contents; // this store entire string with both digits and plus, and I need only $2 value (second digit in this case)