Can someone explain this:
If I select 1 character from my content and run this script
var myText = app.selection;
alert(myText.length); // return "1"
alert(myText.length); // return "2"
I could understand to have "1" and "3" if both tag markers are inserted inside the selection or "1" and "1" if both inserted outside the selection but why this "1" and "2" result ??
@LeftHead – just watch your selection. After adding the xmlElement you will have a selection of two characters. The selected character before adding the xmlElement plus the left right bracket of the xml tag.
The Story Editor window will reveal the "truth" about the current selection ;-)
The "x" of "text" was selected before adding the xmlElement:
Cannot say why this would happen, just that it happens…
Message was edited by: Laubender
That's my point ! My script begin to do what it has to but It's sometimes frustrating to do things because it's like that, not because it's logic