I'd like to know whether a character is or isn't selected via scripting.
This way you can run a script on that portion of text only, instead of the whole text.
Currently, you have to use the Command ID 3018 to apply an animator with a range selector, then read its start and end indexes. And this has to be done before starting any UndoGroup or the text would be deselected.
Instead of using the Command ID, I tried this (again before the UndoGroup)
var animator = layer.Text.Animators.addProperty("ADBE Text Animator");
animator.property("ADBE Text Selectors").addProperty("ADBE Text Selector");
but the second line deselects the text again. So, it's not even an option.
Having to use the Command ID and having to use it before the UndoGroup is a bit of a pain in the ass (not to mention that you also have to delete the animator).
It would be nice to at least being able to use the above code inside the UndoGroup.
Ideally it would be nice to have a CharacterRange object attribute to check if a character is or isn't selected.