Question
[ExtendScript] How to move the cursor to any point in text
I want to select text that matches a regular expression with a length of 0, such as `^`, `$`, or `(?=a)`.
If the length is 1, it can be selected using TextRange, but InsertionPoint does not have a method for selecting text. How can I create and move the cursor to any point?
Requirements:
- Must be implemented using only ExtendScript (AppleScript, AutoHotkey, etc., are not allowed in this case)
- Must be compatible with Illustrator version 2021 or later
- A single-step undo state is preferred, but if it can be achieved with multiple steps, it would be good