[ExtendScript] Document.artboards wrongly returns artboards of active document
- MacOS 14.2.1
- Adobe Illustrator 28.0
- To reproduce:
(a) open two documents with differently named artboards
(b) run this script
for (var i = 0; i < app.documents.length; i++) {
for (var j = 0; j < app.documents[i].artboards.length; j++) {
$.write(app.documents[i].name + ' artboard ' + j + ': ');
$.writeln(app.documents[i].artboards[j].name);
}
}
Expected result:
demo1.ai artboard 0: ALPHA
demo1.ai artboard 1: BRAVO
demo2.ai artboard 0: CHARLIE
demo2.ai artboard 1: DELTA
Actual result:
demo1.ai artboard 0: ALPHA
demo1.ai artboard 1: BRAVO
demo2.ai artboard 0: ALPHA
demo2.ai artboard 1: BRAVO
Note that Document "demo1.ai" is active. If I make demo2.ai active, I get this:
demo2.ai artboard 0: CHARLIE
demo2.ai artboard 1: DELTA
demo1.ai artboard 0: CHARLIE
demo1.ai artboard 1: DELTA
Further links:
-
m1b commented
Good idea Sergey!
-
Sergey Osokin commented
@m1b I have created a snippet checklist of Adobe problems in VSCode. I insert it into the template of a new script and constantly check whether I use a problematic function in that script or not :-D
-
m1b commented
I just spent half an hour troubleshooting a script before I found that the issue was this bug again. If I'm not keeping this bug in mind, it is time consuming to get to the bottom of it each time. I would love to see this fixed!
-
Femke Blanco commented
This appears to go back all the way to CS4.
-
Sergey Osokin commented
This happens on both Mac OS and PC in different versions of Adobe Illustrator.
-
I confirm :(