Copy link to clipboard
Copied
Hi all,
Is that possible?
If I always have 8 documents open, I want to run the script on all 8, but without having to save and close each one - like a WHILE loop would do.
I just can't get this to work on more than one open file...
for (var i = 0; i < app.documents.length; i++) {
var doc = app.activeDocument;
var ABs = doc.artboards;
ABs.setActiveArtboardIndex(176); //put KM variable in here
doc.selectObjectsOnActiveArtboard();
}
Can anyone help at all? Many thanks, J
Add
doc.activate();
after var doc = app.documents[i];
Copy link to clipboard
Copied
Hi @JustyR, change to
var doc = app.documents[i];
Copy link to clipboard
Copied
Hmmm, I thought that would do it, but it still only works on the one open doc.
for (var i = 0; i < app.documents.length; i++) {
var doc = app.documents[i];
var ABs = doc.artboards;
ABs.setActiveArtboardIndex(176); //put KM variable in here
doc.selectObjectsOnActiveArtboard();
}
Copy link to clipboard
Copied
Add
doc.activate();
after var doc = app.documents[i];
Copy link to clipboard
Copied
That did the trick. Many thanks to you both.