No internet connection
  1. Home
  2. How to

If a certain action is aborted, how to skip to next actions until a certain action.

By Mitch Willard @Mitch_Willard
    2022-03-20 01:06:05.962Z2022-03-20 01:26:27.357Z

    I'm writing a script for bouncing a series of mixes that are in a timeline that I have marked with memory locations. I want the script to skip certain actions if a memory location doesn't exist. I've tried the Try/Catch/Finally but to no success, can anyone give any suggestions on how to achieve this?

    here is an exple of the code I'm trying to achieve. If memroy location "101" doesn't exist, I want it to skip the next action of go to memory location "102", if it does exist, I want it to run the action.

    sf.ui.proTools.memoryLocationsGoto({
        memoryLocationNumber: 101,
        onCancel: "Abort",
    });
    
    //Calling command "5 - BOUNCE DIALOG - ID" from package "TAG BOUNCING"
    sf.soundflow.runCommand({
        commandId: 'user:ckugewuha00026v10aurd13dc:cl0ovote0000d281002rv0xxc',
        props: {}
    });
    
    sf.ui.proTools.memoryLocationsGoto({
        memoryLocationNumber: 102,
        onCancel: "Abort",
    });
    
    //Calling command "5 - BOUNCE DIALOG - ID" from package "TAG BOUNCING"
    sf.soundflow.runCommand({
        commandId: 'user:ckugewuha00026v10aurd13dc:cl0ovote0000d281002rv0xxc',
        props: {}
    });
    
    
    

    Thanks

    Mitch

    • 2 replies
    1. Hi Mitch,

      You could do something like this:

      
      let memLocSuccess = sf.ui.proTools.memoryLocationsGoto({
          memoryLocationNumber: 101,
          onError: 'Continue',
      }).success;
      
      //Calling command "5 - BOUNCE DIALOG - ID" from package "TAG BOUNCING"
      if (memLocSuccess) {
          sf.soundflow.runCommand({
              commandId: 'user:ckugewuha00026v10aurd13dc:cl0ovote0000d281002rv0xxc',
              props: {}
          });
      }
      
      1. In reply tochrscheuer:
        Mitch Willard @Mitch_Willard
          2022-03-21 00:26:43.765Z

          Thanks so much @chrscheuer will give it a go.

          Thanks

          Mitch