FORUMS: list search recent posts

rename multiple layers automatically

COW Forums : Adobe Photoshop

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
ellen osborne
rename multiple layers automatically
on Mar 24, 2013 at 8:45:35 pm

Hi
I've imported an animation from After Effects into Photoshop. When I first imported it there were about 189 layers. I've eliminated about two thirds of these layers, which were scattered throughout the document. Now the naming on my layers is no longer consecutive. I'd like to rename the remaining layers consecutively starting with "Layer 1" followed by "Layer 2", etc. I do not want to change the current order. Is there some kind of automatic way to do this? Or do I just need to do it manually?
Thanks for the help.
Ellen


Return to posts index

Dwayne Smith
Re: rename multiple layers automatically
on Mar 24, 2013 at 11:52:16 pm

G'day

You could do it with a script.
Here's one that will work on a Mac — you'd just need to update the version number in the first line.
Copy and paste the script into AppleScript Editor (probably in Applications > Utilities).
Then click the run button (making sure your PS document is open and frontmost)

tell application "Adobe Photoshop CS5"
tell document 1
set mgCountLayers to count layers
set mgCount to 1
repeat with mgLayer from mgCountLayers to 1 by -1
set name of layer mgLayer to ("Layer " & mgCount)
set mgCount to mgCount + 1
end repeat
end tell
end tell


d.


Return to posts index

ellen osborne
Re: rename multiple layers automatically
on Mar 25, 2013 at 10:14:39 pm

Thank you for this. I tried the above. I have my document open. I'm not sure what "frontmost" means. I click "run" but I get the following error "error "Adobe Photoshop CS6 got an error: The requested action requires that the target document is the frontmost document." number 8100"


Return to posts index


ellen osborne
Re: rename multiple layers automatically
on Mar 25, 2013 at 10:49:51 pm

I figured it out the foremost thing. The script worked almost perfectly except it gave the Layer that I wanted to start as Layer 1 (the top layer in the stack) the highest number and then labeled the rest in a descending order. Anyway to get it to start at the top with layer 1?


Return to posts index

Dwayne Smith
Re: rename multiple layers automatically
on Mar 25, 2013 at 10:55:06 pm

HA — I knew I'd get it exactly wrong.

In that case you need a simpler script :

tell application "Adobe Photoshop CS6"
tell document 1
set mgCountLayers to count layers
repeat with mgLayer from 1 to mgCountLayers
set name of layer mgLayer to ("Layer " & mgLayer)
end repeat
end tell
end tell


Have a good one

d.


Return to posts index

ellen osborne
Re: rename multiple layers automatically
on Mar 25, 2013 at 10:59:36 pm

Ok. I know we must almost be there, but now I get this error

error "The variable amp is not defined." number -2753 from "amp"


Return to posts index


Dwayne Smith
Re: rename multiple layers automatically
on Mar 25, 2013 at 11:31:30 pm

Have a look in applescript editor for the line it's failing on (should be highlighted after you get the error).
There's no place the script is asking for the variable "amp" — so I expect there's something incorrect in your compiled script.
Make sure the compiled script matches the one posted.

d.


Return to posts index

ellen osborne
Re: rename multiple layers automatically
on Mar 26, 2013 at 12:07:36 am

Copied and pasted it in again and it worked perfectly! Thanks so much!!!!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]