In photoshop, let’s say I have a few texts layers with contents like this:
Text layer 1: 1@@text01@@abc
Text layer 2: 2@@text02@@cef
Text layer 3: 3@@text03@@hgi
I would like to replace all the layers texts (the content of each text layer inside the artboard, not the layer panel’s names) starting with the first@
and the end@
, that is @@text..@@
to ##
so that results will be:
Text layer 1: 1##abc
Text layer 2: 2##cef
Text layer 3: 3##hgi
Hoe can I achieve this?
Thank you.
2
Answers
I tried myself with the script below, it does works, but don't know if there is any structure I missed:
You need to do basically 3 operations:
A basic* version of this could look like this:
Update: replacing the layer text contents.
Basically the same thing with some additions. You need to check if
layer.kind
isLayerKind.TEXT
and instead of changinglayer.name
you need to changelayer.textItem.contents
*. note that
activeDocument.layers
collection contains only top level layers. If your document has groups (aka folders) or artboards you’ll need to go through nested layers with a different function: something like this