// ISO_ChangeAlphaToStraight.jsx
// Artist: https://www.jasonfletcher.info/
// Code generated by ChatGPT-4o
// Date: May 23, 2025
// Description: This After Effects script will set “Alpha: Straight” (within the Interpret Footage window) for all the selected footage items in the Project window.

{
    var proj = app.project;
    var selectedItems = proj.selection;
    var changedCount = 0;

    app.beginUndoGroup("Set Alpha to Straight");

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

        if (item instanceof FootageItem) {
            var interp = item.mainSource;

            if (interp instanceof FileSource) {
                interp.alphaMode = AlphaMode.STRAIGHT;
                changedCount++;
            }
        }
    }

    app.endUndoGroup();

    alert(
        "Set 'Alpha: Straight' for " +
        changedCount +
        " selected footage item" +
        (changedCount === 1 ? "" : "s")
    );
}