Sort artboards by name
We have over 50 artboards in most of our documents. Is there a way to sort the artboards as listed in the artboards panel by name via script?
We have over 50 artboards in most of our documents. Is there a way to sort the artboards as listed in the artboards panel by name via script?
No way with actions, javascript, vb or any other means to automate this task? Holding out hope if anyone has any ideas J
do you still need it? here's a script, it only works with numbers for now, it needs more work if there are alpha characters in the artboard names.
#target illustrator
// script.name = sortArtboardsNumericallyCS5only.jsx;
// script.description = reArranges the Artboards indexes (for now works with Numbers only)
// script.required = an open document with at least 2 artboards, CS5 only;
// script.parent = CarlosCanto; // 2/21/12;
// script.elegant = false;
var idoc = app.activeDocument;
var abs = idoc.artboards;
var abcount = abs.length; // save the artboard count
var absNames = []; // array to hold artboards names
for (i=0; i<abcount; i++) {
absNames = abs.name; // get all artboard names in an array
}
absNames.sort(function (a,b) { return a-b }); // sort Numerically
// duplicate all artboards, in order according to the sorted array
for (j=0; j<abcount; j++) {
var newAB = idoc.artboards.add(abs.getByName(absNames
).artboardRect); // duplicate AB, which one? go by the sorted array newAB.name = absNames
; // rename artboard }
// delete original set of artboards
for (k=abcount-1; k>=0; k--) {
idoc.artboards.remove(k);
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.