Answered
Is it possible to remove all the empty artboards using script?
The Question is I have nearly about 20 artboards where by chance the number of artboards used may differ based on file.
So I need to remove all the empty artboards.
The Question is I have nearly about 20 artboards where by chance the number of artboards used may differ based on file.
So I need to remove all the empty artboards.
Hi,
Due to some issues of moving code to new forums, code get corrupted. Here is the corrcet version of the above code
#target illustrator
function test() {
var doc = app.activeDocument, thisBoard, selectedObjects;
doc.selection = null;
for (var i = doc.artboards.length - 1; i >= 0; i--) {
thisBoard = doc.artboards[i];
if (doc.artboards.length > 1) {
doc.artboards.setActiveArtboardIndex(i);
selectedObjects = doc.selectObjectsOnActiveArtboard();
if (doc.selection.length < 1 || doc.selection == null) {
thisBoard.remove();
}
}
}
};
test();
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.