HI Forum,
I do need a little tweak on this script...
Thing is, i want to find the last paragraph, last line, last character and make it as full stop...
eg.
• can do anything if you need; (";" to replace with ".").
it is doing that,,,
but if there is no ";" or ":" it is replacing the character d....
I want check the last character is ";" or ":" and to replace with "."
if there is no ";" or ":" just add "." at the end..
myDoc = app.activeDocument;
app.findGrepPreferences = null;
app.findGrepPreferences.bulletsAndNumberingListType = ListType.BULLET_LIST;
var myResults = app.findGrep();
var oDoc = app.activeDocument;
for(n=0; n< myResults.length;n++){
var fnd = myResults[n].paragraphs.lastItem().lines.lastItem();
if(fnd.insertionPoints.itemByRange(-3,-2).contents !== "."){
fnd.insertionPoints.itemByRange(-3,-2).contents = "."
alert(fnd.insertionPoints.itemByRange(-3,-2).contents)
}
}
Many thanks...