Delete all extra artboards
Good Morning 🙂
We need to delete all extra artboards before saving an AI file and I am having a bit of trouble. The number of artboards varies so this bit of script I snagged from another post isn't working: https://community.adobe.com/t5/illustrator-discussions/how-to-delete-specific-artboard-in-illustrator-using-script/td-p/8421652
How can I get the JavaScript to create an array that equals the number of Art Boards so this script can work for our needs?
function removeArtboards ( arr ) {
var i = arr.length; while ( i-- ) activeDocument.artboards[ arr[i] ].remove();
}
removeArtboards( [1,2,3,4,5] );
Thank you!
