Copy link to clipboard
Copied
Hi,
I had selected a text using script. Now I need to place the cursor somewhere in the selected text. Is it possible?
Thanks in advance.
Copy link to clipboard
Copied
It's hard to work with insertion points in Illustrator. Most things are read only.
I think, all that I can give you and what could be useful is this (select a text frame before)
app.activeDocument.selection[0].insertionPoints[0].characters.add("\u0041");
Have fun
![]()
Copy link to clipboard
Copied
Hi pixxxel,
Thank-you for your response. That worked fine. But, my requirement is to have a cursor somewhere in the selected textframe.
Copy link to clipboard
Copied
Sorry, but this is the closest thing that I know. The problem is: you cannot select the type tool afterwards and then funny things happen with the selection if the user want to write something after running the script.
There is IMHO no solution at the moment.
Copy link to clipboard
Copied
Hello, I think there is a way to do so.
 If you use this code snippet:
// replace selection or add at position of the cursor
var vDocRef = app.activeDocument;
var vSelection = vDocRef.pageItems;
var vText = vSelection[0];
var vNewChars = "xx";
// .textSelection[0] = where the cursor is
vText.textSelection[0].contents = vNewChars;
vText.textRange.deSelect(); // deselect if you like
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more