Copy link to clipboard
Copied
I'm surprised at the number of glitches that occur when running ExtendScript. Here's another one:
...
app.executeMenuCommand('deselectall');
alert(doc.selection.length); // not 0
while (doc.selection.length !== 0) {
app.executeMenuCommand('deselectall');
}
// at this point the app freezes
alert(doc.selection.length); // not reached
...
Opinions, advice?
@andyf65867865 - It is working as expected, but at times the application does not get updated.
Try using the
app.redraw();
after
app.executeMenuCommand('deselectall');
like
app.executeMenuCommand('deselectall');
app.redraw();
Please note , the redraw is also very slow. Generally we try to minimize dealings with the DOM as much as possible to avoid slow-downs.
Copy link to clipboard
Copied
@andyf65867865 - It is working as expected, but at times the application does not get updated.
Try using the
app.redraw();
after
app.executeMenuCommand('deselectall');
like
app.executeMenuCommand('deselectall');
app.redraw();
Please note , the redraw is also very slow. Generally we try to minimize dealings with the DOM as much as possible to avoid slow-downs.
Copy link to clipboard
Copied
@Charu Rajput in my example I tried to use redraw() after each `deselectall` and used a test alert inside `while` - and this alert was shown, it turns out that one redraw is not enough
Find more inspiration, events, and resources on the new Adobe Community
Explore Now