Extract automation points via javascript

Hello, this script is supposed to extract points from automation track but doesn’t work because it seems that the automationTrack doesn’t have any “points” property, so volumeTrack.points returns null.
How can refer the points in the automationTrack in js with FMOD 2.03 ?
Thanks!

studio.menu.addMenuItem({
name: “Export Volume Curve to CSV”,
isEnabled: function() { var eventt = studio.window.browserCurrent(); return eventt && eventt.isOfExactType(“Event”); },
execute: function () {

    const event = studio.window.browserCurrent(); // Get the currently selected event
    if (!event) {
        studio.system.message("Please select an event to export its volume curve.");
        return;
    }
    var tracks = event.masterTrack.automationTracks;
	
    var volumeTrack = tracks[0];
	
	let points = volumeTrack.points;
	
	if (points == null) {
        studio.system.message("No automation points found in the volume track.");
        return;
    }
		
    if (points.length == 0) {
        studio.system.message("No automation points found in the volume track.");
        return;
    }

    // Prepare CSV content
    let csvContent = "Time (ms),Volume (dB)\n";
	for (x = 0; x < points.length; x++){
        csvContent += points[x].time + "," + points[x].value + "\n";
    };

    // Save CSV file
    const filePath = studio.system.getFile("C:/extract.csv");
    if (filePath) {
        studio.system.writeFile(filePath, csvContent);
        //studio.system.message("Volume curve exported successfully to: " + filePath);
    } else {
        studio.system.message("Export canceled.");
    }
}

});

Hi,

Thank you for sharing the information and code!

To access the points in automationTrack, you could reference them like this:

var event = studio.window.browserCurrent()
var point = event.groupTracks[0].modules[0].automators[0].automationCurves[0].automationPoints[0]

Please note that this example assumes there is only one instrument on the first audio track with a single automator. You may need to adjust the indices based on your event’s structure.

Hope this helps! Let me know if you have questions.