# Batch rename Labeled Parameter Labels

**URL:** <https://qa.fmod.com/t/batch-rename-labeled-parameter-labels/23795>\
**Category:** FMOD Studio\
**Tags:** javascript\
**Created:** [December 11, 2025, 10:09pm UTC](https://qa.fmod.com/t/batch-rename-labeled-parameter-labels/23795 "2025-12-11T22:09:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![buffalo\_clink](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffalo_clink/32/6712_2.png) [@buffalo\_clink](https://qa.fmod.com/u/buffalo_clink)\
**Post date:** [December 11, 2025, 10:09pm UTC](https://qa.fmod.com/t/batch-rename-labeled-parameter-labels/23795/1 "2025-12-11T22:09:20Z")

</div>

Hi,

Has anyone made a script to do the following:

Labeled Parameter contains many labels with name ‘Old\_Label\_X’ where ‘X’ is some number.

Requirement is to batch update all labels in the parameter to ‘New\_Label\_X’.

Preferably this would be run from the Scripts menu after selecting the target parameter in the Parameters Browser.

Something like the Batch Rename script with a pop-up window for input would be good

I can’t find a way to do this with the existing Batch Rename script.

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [December 17, 2025, 2:59am UTC](https://qa.fmod.com/t/batch-rename-labeled-parameter-labels/23795/2 "2025-12-17T02:59:53Z")

</div>

Hi,

Thanks for the details!

> [@buffalo\_clink](#):
>
> I can’t find a way to do this with the existing Batch Rename script.

For `Labeled parameters`, the label names live in the `enumerationLabels` array, and need to be updated by copying the array and reassigning it back to the parameter.

I have modified the original batch rename script to make it work for the selected labeled parameter’s labels.

You can run it via `Scripts > FMOD Examples > Batch Rename Labels`

```auto
studio.menu.addMenuItem({
    name: "FMOD Examples\\Batch Rename Labels",
    isEnabled: function () {
        var cur = studio.window.browserCurrent();
        return cur && cur.parameter && cur.parameter.enumerationLabels;// Make sure the selected item is label parameter
    },
    execute: function () {

        var cur = studio.window.browserCurrent();
        var p = cur.parameter;

        if (!p || !p.enumerationLabels) {
            studio.system.message("Please select a Labeled Parameter.");
            return;
        }

        var findStr = "";
        var replaceStr = "";
        var dialogRoot = null;

        //Update the preview
        function updatePreview() {
            if (!dialogRoot) return;

            var labels = p.enumerationLabels || [];
            var lines = [];
            for (var i = 0; i < labels.length; i++) {
                if (typeof labels[i] === "string" && labels[i].indexOf(findStr) === 0) {
                    var newName = replaceStr + labels[i].substring(findStr.length);
                    lines.push(labels[i] + " → " + newName);
                }
            }

            var preview = dialogRoot.findWidget("m_preview");
            if (!preview) return;

            preview.setHtml(lines.length ? lines.join("<br/>") : '<font color="Gray">(no matching labels)</font>');
        }

        studio.ui.showModalDialog({
            windowTitle: "Batch Rename Enum Labels",
            windowWidth: 340,
            windowHeight: 230,
            widgetType: studio.ui.widgetType.Layout,
            layout: studio.ui.layoutType.VBoxLayout,
            contentsMargins: { left: 8, top: 8, right: 8, bottom: 8 },
            spacing: 6,
            // Get the dialogRoot
            onConstructed: function () { dialogRoot = this; updatePreview(); },

            items: [
                { widgetType: studio.ui.widgetType.Label, text: "Find" },
                {
                    widgetType: studio.ui.widgetType.LineEdit,
                    widgetId: "m_find",
                    text: findStr,
                    onTextEdited: function () { findStr = this.text(); updatePreview(); }
                },
                { widgetType: studio.ui.widgetType.Label, text: "Replace with" },
                {
                    widgetType: studio.ui.widgetType.LineEdit,
                    widgetId: "m_replace",
                    text: replaceStr,
                    onTextEdited: function () { replaceStr = this.text(); updatePreview(); }
                },
                { widgetType: studio.ui.widgetType.Label, text: "Preview" },
                {
                    widgetType: studio.ui.widgetType.TextEdit,
                    widgetId: "m_preview",
                    isReadOnly: true,
                    minimumHeight: 90,
                    html: '<font color="Gray">(type Find/Replace to preview changes)</font>'
                },
                {
                    widgetType: studio.ui.widgetType.PushButton,
                    text: "Apply",
                    onClicked: function () {
                        //Copy, modify and reassign all target labels
                        var labels = p.enumerationLabels.slice();
                        var changed = 0;

                        for (var i = 0; i < labels.length; i++) {
                            if (typeof labels[i] === "string" && labels[i].indexOf(findStr) === 0) {
                                labels[i] = replaceStr + labels[i].substring(findStr.length);
                                changed++;
                            }
                        }

                        if (changed === 0) {
                            studio.system.message("No labels matched: " + findStr);
                            this.closeDialog();
                            return;
                        }

                        p.enumerationLabels = labels;
                        this.closeDialog();
                    }
                }
            ]
        });
    }
});

```

Hope this helps! Let me know if it works.

---

<div class="post-metadata">

**Author:** ![buffalo\_clink](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffalo_clink/32/6712_2.png) [@buffalo\_clink](https://qa.fmod.com/u/buffalo_clink)\
**Post date:** [December 17, 2025, 11:33pm UTC](https://qa.fmod.com/t/batch-rename-labeled-parameter-labels/23795/3 "2025-12-17T23:33:03Z")

</div>

That’s awesome, thanks for that.

I’ll give this a go and let you know if it works.

---

<div class="post-metadata">

**Author:** ![buffalo\_clink](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buffalo_clink/32/6712_2.png) [@buffalo\_clink](https://qa.fmod.com/u/buffalo_clink)\
**Post date:** [December 18, 2025, 11:11pm UTC](https://qa.fmod.com/t/batch-rename-labeled-parameter-labels/23795/4 "2025-12-18T23:11:00Z")

</div>

@li_fmod Thanks so much. This works brilliantly.
