// Isosceles_RemoveEffectsViaDisable.jsx
// Code generated by ChatGPT-5.5
// Date: June 9, 2026
// Description: This After Effects script will disable all effects on all layers within selected comps. Effects inside nested comps are unaffected. This operation is executed for the selected comps in the Project window.

(function () {

    app.beginUndoGroup("Disable All Effects In Selected Comps");

    var selectedItems = app.project.selection;

    if (selectedItems.length === 0) {
        alert("Please select one or more comps in the Project panel.");
        app.endUndoGroup();
        return;
    }

    var compCount = 0;
    var layerCount = 0;
    var effectCount = 0;

    for (var i = 0; i < selectedItems.length; i++) {

        if (!(selectedItems[i] instanceof CompItem)) {
            continue;
        }

        var comp = selectedItems[i];
        compCount++;

        for (var l = 1; l <= comp.numLayers; l++) {

            var layer = comp.layer(l);
            layerCount++;

            var effects = layer.property("ADBE Effect Parade");

            if (effects !== null) {

                for (var e = 1; e <= effects.numProperties; e++) {

                    var effect = effects.property(e);

                    try {
                        if (effect.enabled) {
                            effect.enabled = false;
                        }
                        effectCount++;
                    } catch (err) {
                        // Some effects may not expose the enabled property.
                        // Ignore and continue.
                    }
                }
            }
        }
    }

    alert(
        "Comps processed: " + compCount + "\n" +
        "Layers processed: " + layerCount + "\n" +
        "Effects disabled: " + effectCount
    );

    app.endUndoGroup();

})();