A script to name Layer Comps the same as layers

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

pmn

A script to name Layer Comps the same as layers

Post by pmn »

I found a script that makes a Layer Comp for each Layer. The script I found is, Layers to Comps 1-1-0.jsx, you can find it here;
http://morris-photographics.com/photosh ... comps.html.

What it does. For example; If I have 3 layers it will make three layer comps, each of the Comps will have one layer each. The new Comps will be named comp_1, comp_2, comp_3. This script does what I want except for the names it give the new Layer Comps.

What I'd like-- Is it possible to have each of the newly generated Layer Comps have the same name as the Layer it is "linked" to? As if the Layers' name was copied and pasted into the new Layer Comps' name field.

So, if my 3 layers, in the example above are named; rose, turnip and soda the 3 layer comps would also be named, rose, turnip and soda.

The work flow I would need to use this I will be working with multiple layered files having different layer counts and all the layers will have different names.

If anyone can help me achieve my goal it would be greatly appreciated. Thanks for you time.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

txuku

A script to name Layer Comps the same as layers

Post by txuku »

Bonjour

line 75 instead of
Code: Select allcompName = 'Comp ' + (compIndex + Math.pow(10, zeroPadding)).toString().substr(1);

you put Code: Select allcompName = doc.layers[layerIndex].name;
pmn

A script to name Layer Comps the same as layers

Post by pmn »

thanks so much! this will be a great time saver. GREAT site!