-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSOHO.jsx
executable file
·61 lines (49 loc) · 1.92 KB
/
SOHO.jsx
1
#target illustratorvar docRef = app.activeDocument;var layerName = "Right-1";var rightLayers = docRef.layers.getByName(layerName);var whitelayer = rightLayers.layers['White']; var varnishlayer = rightLayers.layers['Varnish'];var currentNumber;var color = rightLayers.layers.getByName("Color");for( var i = 1; i <= 100; i++) { color.groupItems['Group'].hidden = true; var group = color.groupItems['Group'].duplicate(); group.hidden = false; var textNumbers = group.textFrames.getByName("Numbers"); if(i < 10) { var currentNumber = "00" + i + "/100"; } else if(i < 100) { var currentNumber = "0" + i + "/100"; } else if(i == 100) { var currentNumber = i + "/100"; } textNumbers.contents = currentNumber; group.name = currentNumber; var groupText = textNumbers.createOutline(); groupText.selected = true; app.executeMenuCommand("Expand3"); groupText.selected = false; groupText.name = "Numbers"; group.KnockoutState var newGroupWhite = group.duplicate(); newGroupWhite.move(whitelayer, ElementPlacement.PLACEATEND); var newGroupVarnish = newGroupWhite.duplicate(); newGroupVarnish.move(varnishlayer, ElementPlacement.PLACEATEND);}color.groupItems['Group'].remove();//// Loop through all items in the document and change spot color based on parent layer/* var whiteSpot = new SpotColor();whiteSpot.spot = docRef.spots['White'];var varnishSpot = new SpotColor();varnishSpot.spot = docRef.spots['Primer']; for(var item = 0; item < docRef.pageItems.length; item++) { if(docRef.pageItems[item].filled == true && docRef.pageItems[item].layer == whitelayer) { docRef.pageItems[item].fillColor = whiteSpot; }else if(docRef.pageItems[item].filled == true && docRef.pageItems[item].layer == varnishlayer) { docRef.pageItems[item].fillColor = varnishSpot; }}*/