Scripting: Check for automation on master track?

Was able to find it like this, which might be a horrible way to do it, but seems to work at least. Wasn’t able to look at effects inside effect chains though, so made a separate post about that.

        function checkEffectForOcclusionParameter(effect) {
            if (effect.automators && effect.automators.length > 0) {
                for (var i = 0; i < effect.automators.length; i++) {
                    var automator = effect.automators[i];
                    if (automator.automationCurves && automator.automationCurves.length > 0) {
                        for (var j = 0; j < automator.automationCurves.length; j++) {
                            var curve = automator.automationCurves[j];
                            if (curve.parameter && curve.parameter.presetOwner && curve.parameter.presetOwner.name === "Occlusion") {
                                return true;
                            }
                        }
                    }
                }
            }
            return false;
        }
1 Like