Answered
Another execution glitch
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?