No internet connection
  1. Home
  2. Macro and Script Help

Extend Delete Muted Script in soundflow.

By Tamás Bohács @bohitomi
    2023-02-25 17:50:33.343Z

    Title

    Extend Delete Muted Script in soundflow.

    What do you expect to happen when you run the script/macro?

    I wanted to modify this script to select the next track, but i realised that even if I want to use keycode it can be vari based on the layout. Is there a way to extend the script to slelect the next track and repeate the script until the end of the session? (I'm very new in scripting, trying my best with chatgpt :P )

    Are you seeing an error?

    key identification?

    What happens when you run this script?

    it works how it supposed to be, delete the muted clips from track but doesn't move to the next track

    How were you running this script?

    I clicked the "Run Script" or "Run Macro" button in SoundFlow

    How important is this issue to you?

    1

    Details

    {
        "inputExpected": "I wanted to modify this script to select the next track, but i realised that even if I want to use keycode it can be vari based on the layout. \nIs there a way to extend the script to slelect the next track and repeate the script until the end of the session? \n(I'm very new in scripting, trying my best with chatgpt :P )",
        "inputIsError": true,
        "inputError": "key identification?",
        "inputWhatHappens": "it works how it supposed to be, delete the muted clips from track but doesn't move to the next track\n",
        "inputHowRun": {
            "key": "-MpfwYA4I6GGlXgvp5j1",
            "title": "I clicked the \"Run Script\" or \"Run Macro\" button in SoundFlow"
        },
        "inputImportance": 1,
        "inputTitle": "Extend Delete Muted Script in soundflow. "
    }

    Source

    // This script clears all muted clips from the currently selected track
    // It includes code from Oliver Momm, Christian Scheuer
    // Note: This version doesn't catch clips with sync points, it will be improved though
    
    // Check if track is selected
    if (!sf.ui.proTools.getMenuItem('Track', 'Make Inactive').isEnabled) {
        return;
    }
    else {
        // "Return" key to go to start of session
        sf.keyboard.press({
            keys: 'return'
        });
    
        // Select first clip
        sf.keyboard.press({
            keys: 'shift+tab'
        });
    
        // Repeat while audio is still selected
        while (sf.ui.proTools.getMenuItem('Clip', 'Group').isEnabled) {
    
            var clipIsMuted = sf.ui.proTools.hasMenuItem('Edit', 'Unmute Clips');
            var clipIsUnmuted = sf.ui.proTools.hasMenuItem('Edit', 'Mute Clips');
            var noClips = sf.ui.proTools.hasMenuItem('Edit', 'Mute');
    
            if (clipIsMuted) {
                // Clip is muted
                // Delete clip
                sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Clear'] });
    
                // "Option+Shift+Tab" keys to extend selection to previous Clip-boundary
                sf.keyboard.press({
                    keys: 'alt+shift+tab'
                });
            }
            else if (clipIsUnmuted || noClips) {
                // Skip clip
                sf.keyboard.press({
                    keys: 'tab'
                });
            }
    
            // Select next clip
            sf.keyboard.press({
                keys: 'shift+tab'
            });
        }
    
        log('Clear Muted Clips', 'All muted clips cleared from this track');
    }
    
    // Go to start of session
    sf.keyboard.press({
        keys: 'return'
    });
    
    // Press "é" key
    sf.keyboard.press({
        keys: 'é'
    });
    
    

    Links

    User UID: t0fgMiaE3PRWfyTijXEL9i1GsUm2

    Feedback Key: sffeedback:t0fgMiaE3PRWfyTijXEL9i1GsUm2:-NP8gef3dQjTc8SsnHhK

    Feedback ZIP

    • 0 replies