Reply to: How to loop through current selectionAugust 28, 2014 at 5:32 pm
Here's one possibility among many.
//XMetaL Script Language JScript:
var rng = ActiveDocument.Range;
var targetElem = “car”;
var insertElem = “u”;
Depending on your actual needs, the full content of your documents, and the starting position for the Selection, that code may either be a good or bad way to solve your issue. Without knowing the full details I cannot say. I suspect that you will find it needs to at least be extended to cover cases that you have not anticipated.