

Usage: Check if an array contains an object. RenameLayerNames(layerSet.layerSets, layerNames) Usage: the core routine for this scriptįunction renameLayerNames(layerSet, layerNames)įor (var i = 0 i < i++)įor (var i = 0 i < i++) I'm looking for all feedback, particularly about any notes about not writing 'proper' JavaScript style.

The format is copied from a pre-existing Photoshop script, so it might be funny looking and I'm not averse to changing it to fit how JavaScript normally works. I wasn't sure if I could just make a function to do the main body of renameLayerNames because I wasn't sure if I could pass the ArtLayer and LayerSet objects by reference or if they'd become copies. In Photoshop, an ArtLayer is just a regular layer, and a LayerSet is a folder that contains layers, so I need to address them both separately. 3.- Additionally you can export to files. 2.- Just 1 click and get all layers renamed. It may also work for photographers who has hundred of photos. It's simply a recursive function that will loop over all the layers in a file and renames any duplicate names to add numbers so every layer name is unique. For certain projects you could need a Photoshop script to rename layers and export them as PNG, for example: videogame creators who needs items in Photoshop. I recently tried to dip back into my old JavaScript 'skills' to make a script for Photoshop.
