Showing artboard order

Artboard position does not correlate with the index
All numbers are collected on a new layer
function showAbIndex(name) {
var doc = activeDocument,
tmpLayer;

try {
tmpLayer = doc.layers.getByName(name);
} catch (e) {
tmpLayer = doc.layers.add();
tmpLayer.name = name;
}

for (var i = 0; i < doc.artboards.length; i++) {
var currAb = doc.artboards[i],
abWidth = currAb.artboardRect[2] - currAb.artboardRect[0],
abHeight = currAb.artboardRect[1] - currAb.artboardRect[3],
label = doc.textFrames.add(),
labelSize = (abWidth >= abHeight) ? abHeight : abWidth;
label.contents = i + 1;
label.textRange.characterAttributes.size = labelSize / 2;
label.position = [currAb.artboardRect[0], currAb.artboardRect[1]];
label.move(tmpLayer, ElementPlacement.PLACEATBEGINNING);
}
}
var layerName = 'ARTBOARD_NUMBERS';showAbIndex(layerName);// do something..removeAbIndex(layerName);function showAbIndex(name) {
var doc = activeDocument,
tmpLayer;

try {
tmpLayer = doc.layers.getByName(name);
} catch (e) {
tmpLayer = doc.layers.add();
tmpLayer.name = name;
}

for (var i = 0; i < doc.artboards.length; i++) {
var currAb = doc.artboards[i],
abWidth = currAb.artboardRect[2] - currAb.artboardRect[0],
abHeight = currAb.artboardRect[1] - currAb.artboardRect[3],
label = doc.textFrames.add(),
labelSize = (abWidth >= abHeight) ? abHeight : abWidth;
label.contents = i + 1;
label.textRange.characterAttributes.size = labelSize / 2;
label.position = [currAb.artboardRect[0], currAb.artboardRect[1]];
label.move(tmpLayer, ElementPlacement.PLACEATBEGINNING);
}
}
function removeAbIndex(name) {
try {
var layerToRm = activeDocument.layers.getByName(name);
layerToRm.remove();
} catch (e) {}
}
Removing numbering in the MoveArtboards script

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store