Copy link to clipboard
Copied
Hello such.
You see, I'm doing a script to select a random TextRange in a textframe.
The script works properly (or so it seems) but when the script ends and the TextRange is selected, if I press the delete key (only disappears selection but not selected text)
I tried to use redraw () and app.redraw () at the end of the script but does not seem to do anything.
is a bug??
You know how could I fix it? Thank you very much in advance.
A greeting.
Copy link to clipboard
Copied
And if you press the delete key again, then all text frame will be deleted.
Behavior of the TextRange.textSelection so strange. It is not like a manually text range selection.
If it was selected via script, then you can do something with the selected text via script (e.g. delete symbols), but not manually.
Copy link to clipboard
Copied
o-marat 撰写:
Behavior of the TextRange.textSelection so strange. It is not like a manually text range selection.
Of course is not like selecting text from the UI using Text tool, from UI we can not select individual words without the blank space also been selected.
So that's just how it works, no fix exists.
Copy link to clipboard
Copied
levi23 schrieb:
Hello such.
You see, I'm doing a script to select a random TextRange in a textframe …
Yes I see --> NOTHING
Please show us the code you already have.
Copy link to clipboard
Copied
Of course
var myDoc = app.activeDocument;
var sel = myDoc.selection[0];
for (a = 0; a < sel.words.length; a++) {
var W = sel.words;
W.select(true)
}
redraw()
I would like the selected text resulting, could be useful for working manually from the program (remove be very useful depending on the code)
Any help please?
Thank you very much