No internet connection
  1. Home
  2. How to

Automation Mode

By Alexander Beer @Alexander_Beer
    2020-09-17 13:58:18.681Z2020-09-17 14:39:45.354Z

    i have a long script to get into our automation mode. although we always create our pro tools sessions from the same template, some sessions have problems with the command in line 73. does anyone have an idea how we can optimize this?

    //Song by Song Automation
    
    //scrolling to cotinous
    sf.ui.proTools.menuClick({
        menuPath: ["Options","Edit Window Scrolling","Continuous"],
    });
    
    
    //Set Auto Write on Stop
    sf.ui.proTools.automationWindow.buttons.whoseTitle.is('Write Automation to Selection on Stop').first.mouseClickElement({
        isOption: true,
    });
    
    //Enable Automation Window Settings
    if (sf.ui.proTools.automationWindow.enablePluginAutoButton.value.invalidate().value !== "Selected")
            sf.ui.proTools.automationWindow.enablePluginAutoButton.elementClick();
    
    if (sf.ui.proTools.automationWindow.enableVolumeAutoButton.value.invalidate().value !== "Selected")
            sf.ui.proTools.automationWindow.enableVolumeAutoButton.elementClick();
    
    if (sf.ui.proTools.automationWindow.enableSendVolumeAutoButton.value.invalidate().value !== "Selected")
            sf.ui.proTools.automationWindow.enableSendVolumeAutoButton.elementClick();
    
    if (sf.ui.proTools.automationWindow.enablePanAutoButton.value.invalidate().value !== "Selected")
            sf.ui.proTools.automationWindow.enablePanAutoButton.elementClick();
    
    if (sf.ui.proTools.automationWindow.enableSendPanAutoButton.value.invalidate().value !== "Selected")
            sf.ui.proTools.automationWindow.enableSendPanAutoButton.elementClick();
    
    
    
    //DYNAMIC TRANSPORT ON
    sf.ui.proTools.menuClick({
        menuPath: ["Options","Dynamic Transport"],
        targetValue: 'Disable'  //or 'Enable' or 'Toggle' or 'Disable' 
    });
    
    //UNSUSPEND GROUP 
    sf.ui.proTools.groupsEnsureGroupListIsVisible();
    
    
    var groupListPopup = sf.ui.proTools.groupsOpenListPopupMenu().popupMenu;
    groupListPopup.menuClickPopupMenu({
        menuPath: ["Suspend All Groups"],
        targetValue: 'Disable'
    });
    
    sf.ui.proTools.appActivateMainWindow();
    
    
    //activate Automation GRP
    sf.ui.proTools.groupsActivate({
        groupNames: ["All Automation"],
    });
    
    
    
    //SELECT TRACKS IN AUTOMATION GRP
    function getGroupListItem(name) {
        var groupList = sf.ui.proTools.mainWindow.tables.whoseTitle.contains('Group').first;
        return groupList.childrenByRole("AXRow").allItems.map(function (r) {
            return {
                row: r,
                selectBtn: r.childrenByRole("AXCell").first.children.first,
                name: r.childrenByRole("AXCell").allItems[1].children.first.title.value.match(/^.+ - ([^(]+)/)[1].replace(/ $/, ''),
            };
        }).filter(function (r) { return r.name == name })[0];
    }
    
    var groupListItem = getGroupListItem("All Automation");
    groupListItem.selectBtn.elementClick();
    
    sf.ui.proTools.selectedTrack.automationModeSet({
        automationModeName: "latch",
        trackTargetMode: "SelectedTracks",
    });
    
    //SELECT TRACKS IN AUTOMATION GRP
    function getGroupListItem(name) {
        var groupList = sf.ui.proTools.mainWindow.tables.whoseTitle.contains('Group').first;
        return groupList.childrenByRole("AXRow").allItems.map(function (r) {
            return {
                row: r,
                selectBtn: r.childrenByRole("AXCell").first.children.first,
                name: r.childrenByRole("AXCell").allItems[1].children.first.title.value.match(/^.+ - ([^(]+)/)[1].replace(/ $/, ''),
            };
        }).filter(function (r) { return r.name == name })[0];
    }
    
    sf.ui.proTools.selectedTrack.automationModeSet({
        automationModeName: "trim",
        trackTargetMode: "SelectedTracks",
    });
    
    
    //Coalessce Trim Automation
    sf.ui.proTools.menuClick({
        menuPath: ["Track","Coalesce Trim Automation"],
    });
    
    
    
    
    
    
    
    
    
    
    • 1 replies
    1. Try to insert this before line 73:

      //Refresh our memory
      sf.ui.proTools.invalidate();
      sf.ui.proTools.selectedTrack.trackScrollToView();