Skip to main content
Participant
June 3, 2016
Question

Extendscript Toolkit - Corrections surlignées

  • June 3, 2016
  • 2 replies
  • 384 views

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 ?

This topic has been closed for replies.

2 replies

Obi-wan Kenobi
Legend
June 3, 2016

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:

Participant
June 3, 2016

Thank you so much. It's work.

karthikS
Inspiring
June 4, 2016

Hi Obi,

Your code simply super

Thanks

Stefan Rakete
Inspiring
June 3, 2016

Hi, you could apply Conditional Text additionally by GREP to the changes you made.

Thanks Stefan