// ISO_RemoveEffectsViaDelete.jsx
// Artist: https://www.jasonfletcher.info/
// Code generated by ChatGPT-5.5
// Date: June 9, 2026
// Description: This After Effects script will delete all effects on all layers within a comp. Effects inside nested comps are unaffected. This operation will be executed for the selected comps in the Project window.

(function () {

    app.beginUndoGroup("Remove All Effects From Selected Comps");

    var selectedItems = app.project.selection;

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

        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) {

                    // Remove effects from last to first
                    for (var e = effects.numProperties; e >= 1; e--) {
                        effects.property(e).remove();
                        effectCount++;
                    }
                }
            }
        }

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

    app.endUndoGroup();

})();
