Unable to get kerning value using indesign script
Hi All,
I am using below indesign code to get the kerning value before the endash, the tool is unable to retrieve the kerning value before the En-dash for the pattern [Number][En dash][Number][Discretionary hyphen] when it falls at the end of a line (screenshot attached).
could someone check let me know how to handle?
var splchar = ["ˆ", "ˇ", "˘", "˙", "˚", "˜", "·", "¯", "", "´", "¨", "", "˛", "¸", "~=", "ˉ"];
var pagesWithKerningIssues = []
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findChangeGrepOptions.includeFootnotes = true;
app.findChangeGrepOptions.includeLockedLayersForFind = true;
app.findChangeGrepOptions.includeMasterPages = false;
for (i = 0; i < splchar.length; i++) {
app.findGrepPreferences.findWhat = splchar[i];
var finds = app.activeDocument.findGrep();
for (j = 0; j < finds.length; j++) {
var characters = finds[j].characters;
for (var k = 0; k < characters.length; k++) {
try {
if (characters[k].insertionPoints[0].kerningValue <= -100) {
var mypage = characters[k].parentTextFrames[0].parentPage.name
pagesWithKerningIssues.push(mypage);
}
} catch (e) {
}
}
}
}
app.findGrepPreferences = NothingEnum.NOTHING;
app.changeGrepPreferences = NothingEnum.NOTHING;