# FMOD Studio Script to retrieve automation data

**URL:** <https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152>\
**Category:** FMOD Studio\
**Created:** [July 12, 2025, 1:33pm UTC](https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152 "2025-07-12T13:33:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [July 12, 2025, 1:33pm UTC](https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152/1 "2025-07-12T13:33:26Z")

</div>

I’m trying to generate a .js script to retrieve the information of all the automations inside a FMOD Studio project. This is the script I’ve been working on, but I can’t seem to find the right data. I achieved to retrieve a list of all the events in the project, but then, I can’t find any more information. All the variables “automator”, “automationCurve”, and so on are empty, even if there are automations in my project.

Do someone know how could I retrieve the information of the automation curves/points, or at least, where is it stored or why are all those variables empty?

Thank you!

Script code:

```auto
studio.menu.addMenuItem({
    name: "Export Automation JSON",
    execute: function () {
        exportAutomationJSON();
    }
});

function exportAutomationJSON() {
    var events = studio.project.model.Event.findInstances();
    if (!events || events.length === 0) {
        alert("No s'han trobat events al projecte");
        return;
    }

    var data = {};

    events.forEach(function (event) {

        var eventData = {
            name: event.name,
            path: event.getPath(),
            automations: []
        };

        function extractAutomationFrom(obj, label) {
            if (!obj || !obj.modulators) return;

            obj.modulators.forEach(function (modulator) {
                if (modulator.automation && modulator.automation.points.length > 0) {
                    var points = modulator.automation.points.map(function (pt) {
                        return {
                            time: pt.time,
                            value: pt.value
                        };
                    });

                    eventData.automations.push({
                        context: label,
                        modulatorType: modulator.type,
                        points: points
                    });
                }
            });
        }

        function traverseTrack(track, pathLabel) {
            extractAutomationFrom(track.volume, pathLabel + " Volume");
            extractAutomationFrom(track.pitch, pathLabel + " Pitch");

            if (track.modules) {
                track.modules.forEach(function (module, i) {
                    // Nom de l'efecte
                    var modLabel = pathLabel + " > Effect[" + i + "] (" + module.name + ")";
                    extractAutomationFrom(module.volume, modLabel + " Volume");
                    extractAutomationFrom(module.pitch, modLabel + " Pitch");

                    // Altres propietats que podrien tenir moduladors
                    if (module.properties) {
                        Object.keys(module.properties).forEach(function (propName) {
                            var prop = module.properties[propName];
                            extractAutomationFrom(prop, modLabel + " Property: " + propName);
                        });
                    }
                });
            }

            if (track.children) {
                track.children.forEach(function (childTrack, i) {
                    traverseTrack(childTrack, pathLabel + " > SubTrack[" + i + "]");
                });
            }
        }

        try {
            if (event.masterTrack) {
                traverseTrack(event.masterTrack, "MasterTrack");
            }
        } catch (e) { alert(e); }

        if (eventData.automations.length > 0) {
            data[event.getPath()] = eventData;
        }
    });

    var json = JSON.stringify(data, null, 4);

    var outputPath = studio.project.filePath;
    if (!outputPath) {
        alert("No es pot determinar la ruta del projecte. Guarda el projecte abans d'executar.");
        return;
    }

    outputPath = outputPath.replace(/\\/g, "/");
    outputPath = outputPath.substr(0, outputPath.lastIndexOf("/") + 1) + "automation_export.json";

    var textFile = studio.system.getFile(outputPath);
    if (!textFile.open(studio.system.openMode.WriteOnly)) {
        alert("No s'ha pogut obrir el fitxer per escriure.");
        return;
    }

    textFile.writeText(json);
    textFile.close();

    alert("Exportació d'automatitzacions completada a:\n" + outputPath);
}

```

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [July 16, 2025, 6:53am UTC](https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152/2 "2025-07-16T06:53:29Z")

</div>

Hi,

All property modulations for events belong to master/group tracks. Any automation applied to properties or modules on that track can be found in `track.automationTracks[i]`. You can find the following information for a given `var automationTrack = track.automationTracks[i]`:

- The name of the property being automated is stored in `automationTrack.automator.nameOfPropertyBeingAutomated`
- The object (i.e. module, effect, etc.) being automated is stored in `automationTrack.automator.objectBeingAutomated`
- The points of the automation curve are stored as an array `automationPoints` belonging to the given automation curve - i.e. `automationTrack.automator.automationCurves[j]

For reference, the function `.dump()` can be used on all `ManagedObjects` in the Studio Scripting API, and will provide a list of all members for that object, which is helpful when writing scripts.

---

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [July 16, 2025, 11:33am UTC](https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152/3 "2025-07-16T11:33:53Z")

</div>

Okey, I know about the variable “track”, but I don’t know how to access it? Where do I find it? Is there a way to gather all the tracks?  
I know events can be gathered like:

```auto
var events = studio.project.model.Event.findInstances();

```

The problem is that the class Event does not have a track variable inside to then access track.automationTracks[i].

I hope you could answer my new question!

Thank you for your response, it was super useful!

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [July 24, 2025, 3:42am UTC](https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152/4 "2025-07-24T03:42:21Z")

</div>

> [@raxersound](#):
>
> Okey, I know about the variable “track”, but I don’t know how to access it? Where do I find it? Is there a way to gather all the tracks?

The master track for an event can be found at `event.masterTrack`, and all other group tracks are stored in an array `event.groupTracks[]`.

---

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [August 1, 2025, 2:20pm UTC](https://qa.fmod.com/t/fmod-studio-script-to-retrieve-automation-data/23152/5 "2025-08-01T14:20:42Z")

</div>

Okey, that solves everything!!  
Thank you so much!!
