No internet connection
  1. Home
  2. How to

Increase Edit Selection Length by x Amount

By Kaspar @Kaspar
    2023-09-26 09:46:06.181Z

    Hey I'd like to be able to select the edit selection and then input
    *10000 Enter

    In order to increase selection by one minute.

    Previously you could focus the 'Length' parameter with * to focus timecode and cycle to Length with /
    This no longer works.

    Does anyone know if there's a work around to achieve what I'm after?

    Thanks

    Kaspar

    Solved in post #2, click to view
    • 2 replies
    1. Chad Wahlbrink @Chad2023-09-26 14:52:59.597Z

      Hey @Kaspar!

      It seems that you can still cycle to the "Edit Selection Length" field by only pressing the "/" key (it does not work if you press the "*" key first).

      Still, if you'd like a way to directly access this field, you can always use

      sf.ui.proTools.mainWindow.counterDisplay.textFields.whoseTitle.is("Edit Selection Length").first.elementClick();
      

      Then, you can expand this to a script like this which will set the selection length to 1 second if the main counter is in timecode.
      if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
      
      sf.ui.proTools.appActivateMainWindow();
      sf.ui.proTools.mainWindow.invalidate();
      
      // Select Selection Length Field
      sf.ui.proTools.mainWindow.counterDisplay.textFields.whoseTitle.is("Edit Selection Length").first.elementClick();
      
      // Clear Field
      sf.keyboard.press({
          keys: "numpad equals",
      });
      
      // Set to 1 Second
      sf.ui.proTools.mainWindow.counterDisplay.textFields.whoseTitle.is("Edit Selection Length").first.elementSetTextFieldWithAreaValue({value:"00:00:01:00", useMouseKeyboard:true});
      
      // Hit Return
      sf.keyboard.press({keys:"return"});
      
      Reply1 LikeSolution
      1. K
        In reply toKaspar:
        Kaspar @Kaspar
          2023-09-27 16:14:11.079Z

          Ah brilliant thanks Chad!