AI Script – Sort Layers Alphabetically

Illustrator Script Sort application active document layers alphabetically /*#target illustrator*/ main(); function main(){ if(!documents.length) return; var doc = app.activeDocument; var allLayers = app.activeDocument.layers; var visibleLayers = []; for(a=0; a<allLayers.length; a++){ var ilayer = allLayers[a]; if (ilayer.visible) { visibleLayers.push(ilayer); } }; var alphabetizedLayers = visibleLayers.sort( function(a,b) { return a > b } ); sort_layers(doc, alphabetizedLayers); } […]

AI Script – Sort Layers Alphabetically Read More ยป