• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

force redraw() script

Explorer ,
Nov 05, 2016 Nov 05, 2016

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.

TOPICS
Scripting

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Engaged ,
Nov 05, 2016 Nov 05, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 21, 2016 Nov 21, 2016

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2016 Nov 06, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 06, 2016 Nov 06, 2016

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines