Copy link to clipboard
Copied
Bonjour,
j'ai un script le correction de textes dans InDesign (style GREP) super efficace, mais mon problème c'est que j'aimerais que les corrections effectuées soient surlignées pour voir ce qui a été corrigé. Y a-t-il un outil ou un ajout au script que je pourrais faire ?
Copy link to clipboard
Copied
Hi, you could apply Conditional Text additionally by GREP to the changes you made.
Thanks Stefan
Copy link to clipboard
Copied
Marie-Odile,
You could take a look to this code:
var myDoc = app.activeDocument;
for (var i = 1; i <= 20; i++) {
myCondition = app.activeDocument.conditions.item("Grep_" + (i));
if (!myCondition.isValid)
{
myCondition = app.activeDocument.conditions.add ({name: "Grep_" + (i), indicatorMethod: ConditionIndicatorMethod.USE_HIGHLIGHT});
}
}
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\b\\w{4}\\b";
app.changeGrepPreferences.appliedConditions = ["Grep_1"];
myDoc.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\b\\w{6}\\b";
app.changeGrepPreferences.appliedConditions = ["Grep_2"];
myDoc.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\b\\w{8}\\b";
app.changeGrepPreferences.appliedConditions = ["Grep_3"];
myDoc.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
Before:
After:
Copy link to clipboard
Copied
Thank you so much. It's work.
Copy link to clipboard
Copied
Hi Obi,
Your code simply super
Thanks