search the "keyword", set textRange,
and creatOutlines(false) method against the textRange.
("false" propety remain original texts objects)
you can get geometricBounds of "keywords" as Polygons
then remove Outlined texts(polygons)
//ex) var outTxt = app.selection.createOutlines (false); var textBon = outP.geometricBounds; outTxt . remove ();
1 person found this helpful
In addition to the createOutlines approach illustrated above by milligramme, you can access to various measurement properties provided by Text objects, especially the horizontalOffset property -- which works on InsertionPoint too. It depends on your needs. createOutlines allows you to get the coordinates of a full bounding box (for each line), but it may have significant performance cost.
Many Thanks for you.
It works perfect.
Many thanks for your timely help.