Last active
August 6, 2025 00:05
-
-
Save atroia/83f8ace298599c0b48652feae1714588 to your computer and use it in GitHub Desktop.
Add layers and rename "Layer 1" layer to "Text"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var d = app.activeDocument; | |
| layerNames(); | |
| function layerNames() { | |
| // layer options | |
| var layerImage1 = d.layers.add({name:"Images", locked:true, layerColor:UIColors.BLUE}); | |
| var layerGuides = d.layers.add({name:"Guides", locked:true, layerColor:UIColors.GREEN}); | |
| var layerBookline = d.layers.add({name:"Bookline", locked:false, layerColor:UIColors.RED}); | |
| // var layerImage2 = d.layers.add({name:"Images - Below", locked:true}); | |
| // rename Layer 1 to Text | |
| if (d.layers.itemByName("Layer 1")){ | |
| d.layers.item('Layer 1').name = 'Text'; | |
| } else { | |
| return; | |
| } | |
| layerImage1.move(LocationOptions.AT_BEGINNING); | |
| layerGuides.move(LocationOptions.AT_BEGINNING); | |
| layerBookline.move(LocationOptions.AT_BEGINNING); | |
| // layerImage2.move(LocationOptions.AT_END); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment