Skip to main content
Participant
October 9, 2026
Question

Bulk Rename/Edit Artboard Names in Photoshop

  • October 9, 2026
  • 1 reply
  • 12 views

Not a question per-se, I just wanted to share this script I wrote to bulk rename artboards, so my fellow PS users can have an easier time of it.

I’ve added this as a keyboard shortcut and it’s saved me SO much time!

Enjoy! And if you have any improvements, please add & share.


 


#target photoshop

(function () {
    if (app.documents.length === 0) {
        alert("Please open a Photoshop document first.");
        return;
    }

    var doc = app.activeDocument;
    var s2t = stringIDToTypeID;

    var findText = prompt("FIND: Text to replace:", "");
    if (findText === null) return;

    if (findText.length === 0) {
        alert("Find text cannot be empty.");
        return;
    }

    var replaceText = prompt("REPLACE WITH: New text:", "");
    if (replaceText === null) return;

    var changed = 0;
    var unmatched = 0;
    var detected = 0;

    function isArtboard(group) {
        try {
            var ref = new ActionReference();
            ref.putProperty(
                s2t("property"),
                s2t("artboardEnabled")
            );
            ref.putIdentifier(s2t("layer"), group.id);

            var desc = executeActionGet(ref);

            return desc.hasKey(s2t("artboardEnabled")) &&
                desc.getBoolean(s2t("artboardEnabled"));
        } catch (e) {
            return false;
        }
    }

    function processGroups(container) {
        for (var i = 0; i < container.layerSets.length; i++) {
            var group = container.layerSets[i];

            if (isArtboard(group)) {
                detected++;

                var pos = group.name.indexOf(findText);

                if (pos !== -1) {
                    group.name =
                        group.name.substring(0, pos) +
                        replaceText +
                        group.name.substring(pos + findText.length);

                    changed++;
                } else {
                    unmatched++;
                }
            }

            processGroups(group);
        }
    }

    try {
        processGroups(doc);

        alert(
            "Finished!\n\n" +
            "Artboards detected: " + detected + "\n" +
            "Artboards renamed: " + changed + "\n" +
            "Artboards without a match: " + unmatched
        );

        if (detected === 0) {
            alert(
                "No artboards were detected. " +
                "No names were changed."
            );
        }
    } catch (e) {
        alert("Error: " + e.message);
    }
})();

    1 reply

    justlearnskills
    Community Expert
    Community Expert
    October 9, 2026

    ​@different_Swirl8e6d that’s a helpful tool! I always thought there was a ‘rename layers’ but it doesn’t work in bulk! 

    m