Skip to main content
December 2, 2025
Open for Voting

Find/Replace for layers in photoshop

  • December 2, 2025
  • 3 replies
  • 49 views

Would like to see a simple Find/replace name/text on layers in Photoshop. I do alot of production work using artboards and would like to easily change the file names of my assets without having go layer by layer to do so.

3 replies

Legend
December 2, 2025

Just as a sample, this is a script that walks through text layers and renames them based on the text contents. You could write something similar with a window to input your search and replace pairs.

 

/*
Utility Pack Scripts created by David M. Converse ©2018-24

This script renames text layers in an open Photoshop document

Last modifed 7/5/2024

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target photoshop

renameTextLayers();

function renameTextLayers(){
    if(!app.documents.length > 0){
        return;
        }
    var docRef = null;
    var vis = true;
    var LayerRef = null;
    var TextRef = null;
    var layerText = '';
    try{
        docRef = app.activeDocument;
        docRef.activeLayer = docRef.artLayers[0];
        for(var i = 0; i < docRef.artLayers.length; i++){
            LayerRef = docRef.artLayers[i];
            vis = true;
            if(LayerRef.kind == LayerKind.TEXT){
                if(!LayerRef.visible){
                    vis = false;
                    }
                TextRef = LayerRef.textItem;
                layerText = TextRef.contents;
                layerText = layerText.replace(/\r$/, '');
                layerText = layerText.replace(/,\r/, ', ');
                if(layerText.search('\r') == -1){
                    layerText = layerText.split(' ');
                    layerText[0] = layerText[0].replace(',', '');
                    }
                else{
                    layerText = layerText.split('\r');
                    }
                LayerRef.name = layerText[0];
                if(vis == false){
                    LayerRef.visible = false;
                    }
                }
            }
        }
    catch(e){
        Window.alert(e + e.line);
        }
    }
December 2, 2025

That would be a super helpful feature! A simple find-and-replace tool for layer names would save a ton of time, especially when working with large artboards and multiple assets. It’d make production work much faster and eliminate the need to rename layers one by one.

Legend
December 2, 2025

You can filter layers by name. You could also use a script that walks through layers and renames as needed.