Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Rename Layers: Find and Replace style renaming

$
0
0

In Illustrator, you can use the following to find and replace layer names:

 

var doc = app.activeDocument; 

// name indexed object 

var layernames = { 

'Bob':'Bob Front'

}; 

// loop through all layers 

for (var i = 0; i < doc.layers.length; i++) 

//Set up Variable to access layer name 

var currentLayer = app.activeDocument.layers[i]; 

if (layernames[currentLayer.name]) 

  currentLayer.name = layernames[currentLayer.name]; 

In this script "Bob" will become "Bob Front". Is there something similar for Photoshop. Looking at the Photoshop scripting guide, this script should work as the active App document and layers methods exist in Photoshop.


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>