var txt = "";
var i = 1;
while (true) {
    try {
        var ref = new ActionReference();
        ref.putIndex(charIDToTypeID("ASet"), i);
        var desc = executeActionGet(ref);
        var setName = desc.getString(charIDToTypeID("Name"));
        txt += "Set: " + setName + "\n";
        
        var j = 1;
        while (true) {
            try {
                var refAct = new ActionReference();
                refAct.putIndex(charIDToTypeID("Actn"), j);
                refAct.putIndex(charIDToTypeID("ASet"), i);
                var descAct = executeActionGet(refAct);
                var actName = descAct.getString(charIDToTypeID("Name"));
                txt += "  - Action: " + actName + "\n";
                j++;
            } catch (e) {
                break;
            }
        }
        i++;
    } catch (e) {
        break;
    }
}

var f = new File("C:/Users/kraaz/Desktop/photoshop_actions.txt");
f.open("w");
f.write(txt);
f.close();
