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

Script help for exporting stems in GarageBand

By Steven Moreland @Steven_Moreland
    2024-07-09 15:32:31.510Z

    Title

    Script help for exporting stems in GarageBand

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

    Solo a track then export that track to disk. Then solo the next track and export that track to disk.

    Are you seeing an error?

    What happens when you run this script?

    The script run and exports the tracks with the name "Tracks 1" etc. and puts them in the folder. The problem is that it is not soloing any tracks. So I get 5 exported tracks each sounding the same because nothing is soloed each time.

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "Solo a track then export that track to disk. Then solo the next track and export that track to disk.",
        "inputIsError": false,
        "inputWhatHappens": "The script run and exports the tracks with the name \"Tracks 1\" etc. and puts them in the folder. The problem is that it is not soloing any tracks. So I get 5 exported tracks each sounding the same because nothing is soloed each time.",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 5,
        "inputTitle": "Script help for exporting stems in GarageBand"
    }

    Source

    
    
    function exportSongToDisk(trackNumber) {
    
        let exportSongWin = sf.ui.app('com.apple.garageband10').windows.whoseTitle.is('Export Song to Disk').first
    
        sf.ui.app('com.apple.garageband10').menuClick({ menuPath: ["Share", "Export"], looseMatch: true });
    
        exportSongWin.textFields.first.elementSetTextFieldWithAreaValue({
            value: "Track " + ++trackNumber
        });
    
        exportSongWin.radioButtons.whoseTitle.is('WAVE').first.elementClick();
    
        exportSongWin.buttons.whoseTitle.is('Export').first.elementClick();
    
    }
    
    sf.ui.app('com.apple.garageband10').appActivate()
    
    sf.ui.app('com.apple.garageband10').menuClick({ menuPath: ["Edit", "Select All"] });
    
    let track = sf.ui.app('com.apple.garageband10').mainWindow.groups.whoseDescription.is('Tracks').first.splitGroups.first.splitGroups.allItems[1].scrollAreas.first.groups.whoseDescription.is('Tracks header').first.children.whoseRole.is("AXLayoutItem")
    
    let tracksLength = track.map(x => x.title).length
    
    for (var i = 0; i < tracksLength; i++) {
    
    
        track.allItems[i].checkBoxes.whoseDescription.is("Solo").first.elementClick();
    
        exportSongToDisk(i)
    
        sf.ui.app('com.apple.garageband10').windows.whoseTitle.is("GarageBand").first.elementWaitFor({
            timeout: -1,
            waitType: "Appear"
    
        });
    
        sf.ui.app('com.apple.garageband10').windows.whoseTitle.is("GarageBand").first.elementWaitFor({
            timeout: -1,
            waitType: "Disappear"
    
        });
    
        sf.wait()
    
        track.allItems[i].checkBoxes.whoseDescription.is('Solo').first.elementClick();
    
    }
    alert("Done!")
    
    

    Links

    User UID: rGKyurn0W5gL0x2QMMoMDt6Jqkv1

    Feedback Key: sffeedback:rGKyurn0W5gL0x2QMMoMDt6Jqkv1:-O1N6zkkfA5K3vT8SjiO

    Feedback ZIP: DXSmOsDIeDS2ydiVJ8wG9UtEMSl5on1ZMGI2tDLzHmq61nO6huwglWKqJ6XcX5xXDodhIZLaBcs9q1y62wXWNJyzkaei7AJyAWbr+/NSK9ZlTw+wj46Grh14TiW2ZViIFZjvQAu9hosXriyLFY+a1DA7fgzv5RT5r01It0v5edRMeAhZgIlhRwnPMlwENly8ti78ISeJNcIRMgetwRiMxo+8+NMVaZRC361nG+CVDosKkogjDIsYJ6lZtPAuIKojAg1FhCLtO0UPT1s79aFtldBRkAE9b01Gsvr1Cx31VQnY4Eh3XcobWrvn4z/6fltOgQZFrxYliIxuVDU24G7RDbTiAQJL00f2sOBe5cnMSy4=

    • 0 replies