Changegrep behaviour different via scripting vs UI w.r.t applied character formatting
Hello All,
I noticed that when we use change grep via scripting the changed texts character formatting are adjusted based on the number of characters removed or added. However, this does not happen when the same is done using the InDesign UI. Let me explain with an example
If the Indesign test is as follows, notice BCD are underlined
5. ABCDEFG
Now if use changegrep to remove 3 characters before A. The results are different with scripting vs UI
With scripting, the result is as follows
ABCDEFG
The underline is shifted to the right 3 places to adjust the removal of 3 characters
With UI this does not happen and the underline stays under BCD. Is this a bug or am I missing something? For more details see the screengrab via the link given below
app.findGrepPreferences = app.changeGrepPreferences = null
app.findGrepPreferences.findWhat= "(\\d*\\.\\s+)(.*)"
app.changeGrepPreferences.changeTo = "$2"
app.documents[0].changeGrep()
app.findGrepPreferences = app.changeGrepPreferences = null
-Manan


