No internet connection
  1. Home
  2. How to
  3. Pro Tools

Help With Bounce Automation Script

By Beau Burchell @Beau_Burchell
    2025-04-07 19:29:54.255Z2025-05-01 15:50:52.336Z

    I've pieced together a script of macros, that will select a marker selection, copy the name of that marker selection, open bounce to disk dialogue, paste the name of the selection in the text field, and bounce to disk.
    I'd love to be able to have this command wait for the bounce to finish, then select the next marker selection (increase memory location by 1) and repeat the process until there are no more markers.

    The application is for Live album or studio album mixing with lots of songs in one session. I use Marker selections to define the bounce locations of each song.

    I typically start my song / marker selections starting at 101 to avoid any conflicts with regular marker locations.

    Thanks In advance.
    Beau

    
    //Calling command "Focus Pro Tools, Center Cursor on Edit Window" from package "Pro Tools Utilities" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ck1w23x1o0000ef10gotnvo1z/cko4vno0300016y10lm312ray")
    sf.soundflow.runCommand({
        commandId: 'user:ckyaggnjz0002hm10vezxdqq3:ck1w3h03r000tef10hc8eks5k',
        props: {}
    });
    
    //Calling command "Show: Memory Locations" from package "Pro Tools" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/cm5fn5kmt00001d10sopm2o30")
    sf.soundflow.runCommand({
        commandId: 'user:ckp49i4j60000a2100yfwywgf:cku7r4tjf00070t10edyt27kp#cksgeba3z0003rw106ha0mwhy',
        props: {}
    });
    
    sf.ui.proTools.memoryLocationsGoto({
        memoryLocationNumber: 101,
        useKeyboard: false,
    });
    
    function editMemLoc(number) {
        var numberStr = (number + '');
        var keys = [
            `numpad comma`,
            ...(Array.from(numberStr).map(c => `numpad ${c}`)),
            `numpad enter`,
        ].join(', ');
        //log(keys);
        sf.ui.proTools.appActivateMainWindow();
        sf.keyboard.press({ keys: keys, });
    }
    
    editMemLoc(101);
    
    sf.keyboard.press({
        keys: "cmd+c",
    });
    
    sf.keyboard.press({
        keys: "return",
    });
    
    //Calling command "Bounce Mix..." from package "Pro Tools" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/cm5fn5kmt00001d10sopm2o30")
    sf.soundflow.runCommand({
        commandId: 'user:ckp49i4j60000a2100yfwywgf:cktcnf0ra000x9r109i8wen1u#cktcms2j4000h9r103zqxnmg5',
        props: {}
    });
    
    sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.elementWaitFor();
    
    sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.textFields.first.elementClick();
    
    sf.keyboard.press({
        keys: "cmd+v",
    });
    
    sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.whoseTitle.is("Bounce").first.elementClick();
    
     //Start the Bounce, and wait for it to finish!
            bounceDlg.buttons.whoseTitle.is('Bounce').first.elementClick();
            sf.wait({ intervalMs: 2000 });
            sf.ui.proTools.waitForNoModals();
    
            
    
    Solved in post #3, click to view
    • 4 replies
    1. B
      Beau Burchell @Beau_Burchell
        2025-05-03 17:23:42.316Z

        Just bumping this, looking for some help.

        1. Hey @Beau_Burchell! Big fan of your work ๐Ÿชฒ๐Ÿค˜๐Ÿผ

          Bouncing can be a complicated topic but let's get the ball rolling and build off the script you've provided and take care of any errors/adjustments as they come up.

          The script below will go through all Memory Locations, starting at the provided number, select and bounce them out with their name as the bounce name.

          Let me know how it behaves on your end.

          /** 
           * @param {object} args
           * @param {string} args.fileName - Name of the bounce
           */
          function bounce({ fileName }) {
              const bounceMixWindow = sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first;
          
              sf.ui.proTools.appActivate();
          
              // Bring up the Bounce Mix window
              sf.ui.proTools.menuClick({ menuPath: ["File", "Bounce Mix..."] });
              bounceMixWindow.elementWaitFor();
          
              // Set Bounce File Name
              bounceMixWindow.textFields.first.elementSetTextFieldWithAreaValue({
                  value: fileName
              });
          
              // Press "Bounce" button
              bounceMixWindow.buttons.whoseTitle.is("Bounce").first.elementClick();
              bounceMixWindow.elementWaitFor({ waitType: "Disappear" });
          
              // Wait for bounce
              sf.ui.proTools.waitForNoModals();
          }
          
          /** 
           * @param {object} args
           * @param {number} args.startingMemoryLocationNumber - Number to start bounces at
           */
          function bounceMemoryLocations({ startingMemoryLocationNumber }) {
              const memoryLocations = sf.app.proTools.memoryLocations.invalidate().allItems;
              const bounceMemoryLocations = memoryLocations.filter(memLoc =>
                  memLoc.number >= startingMemoryLocationNumber
              );
          
              if (bounceMemoryLocations.length === 0) {
                  throw `No Memory Locations starting at ${startingMemoryLocationNumber} found.`
              }
          
              // Bounce Memory Locations
              bounceMemoryLocations.forEach(memLoc => {
                  // Select Memory Location
                  sf.app.proTools.selectMemoryLocation({ number: memLoc.number });
          
                  // Bounce
                  bounce({ fileName: memLoc.name });
              });
          }
          
          bounceMemoryLocations({
              startingMemoryLocationNumber: 101
          });
          

          Tested on a light-weight session on PT 2024.10.2

          Reply1 LikeSolution
          1. BBeau Burchell @Beau_Burchell
              2025-05-03 22:59:16.180Z

              Raphael,
              This works perfectly!
              Thank you so much!
              Just tested on a 12 song album with about 80 tracks and very heavy processing.
              I'm running PT ultimate 2024.10.2

              PS> thank you for the kind words :)
              B

              1. Sweeeet. Thatโ€™s definitely a robust test you put it through. Glad we got it first try ๐Ÿ™Œ๐Ÿผ