Home › Forums › General XMetaL Discussion › I can’t get this macro to replace the text in an element › Reply To: I can’t get this macro to replace the text in an element
Reply to: I can’t get this macro to replace the text in an element
February 28, 2012 at 6:34 pmI think I understand what you want.
If my assumption is correct you should only need to delete this line:
rng.SelectElement();
As it is now, the script is doing this:
1) Moving just inside each of the named elements
2) Selecting the entire element.
3) Selecting the content of the element that is containing that element.
You want it to do this:
1) Move to the named element.
2) Select everything inside it.
3) Type over whatever is selected with some text.