No internet connection
  1. Home
  2. How to

Make all existing markers track markers

By Jack Byrne @Jack_Byrne
    2023-09-20 13:12:03.744Z

    Hey all!

    Dealing with an audiobook edit that's been run through pozotron, so I'm importing a ton of markers that's generated. Is there a way to script up going through every single marker in a session and changing it to a track marker? I don't even care which track it's on, I'm going to make tweaks to everything as a group, I just don't want them getting massively thrown off by the end once I start to edit things, I've got like 700 something to pull in because the way it's been run through pozotron for this edit is bloody stupid

    • 2 replies
    1. Chad Wahlbrink @Chad2023-09-20 15:34:28.293Z

      Hey @Jack_Byrne!

      One solution to this would be to select all of the markers in the global marker lane, "Edit > Cut" the markers, select your target track for the track markers, then "Edit > Paste." Here's a script version of that:

      if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
      
      // Activate Pro Tools
      sf.ui.proTools.appActivateMainWindow();
      sf.ui.proTools.mainWindow.invalidate();
      
      // Capture Target Track for Track Markers
      let selectedTrack = sf.ui.proTools.selectedTrack.normalizedTrackName;
      
      if (!sf.ui.proTools.getMenuItem('View', 'Rulers', 'Markers').isMenuChecked) {
          sf.ui.proTools.menuClick({ menuPath: ['View', 'Rulers', 'Markers'], });
      }
      if (!sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Marker Controls').isMenuChecked) {
          sf.ui.proTools.menuClick({ menuPath: ['View', 'Edit Window Views', 'Marker Controls'], });
      }
      
      // Update UI
      sf.ui.proTools.mainWindow.invalidate();
      
      // Define Global Marker Lane
      let globalMarkerLane = sf.ui.proTools.mainWindow.tables.whoseTitle.is("Markers").first;
      
      // Click into Global Marker Lane
      globalMarkerLane.mouseClickElement({ relativePosition: { x: 2, y: 2 } })
      
      // Select All Markers
      sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Select All'], });
      // Extend Selection to Session Start
      sf.keyboard.press({keys:'shift+return'});
      // Extend Selection to include last  Marker
      sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Selection', 'Double Edit'], });
      // Cut Markers
      sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Cut'], });
      
      // Select Target Track
      sf.ui.proTools.trackSelectByName({ names: [selectedTrack], });
      // Scroll Track into View
      sf.ui.proTools.selectedTrack.trackScrollToView();
      
      // Click into the Grid Area of Pro Tools
      sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Markers View").first.mouseClickElement({relativePosition: { x: 100, y: 0, }});
      
      // Set Selection to Session Start
      sf.keyboard.press({keys:'return'});
      
      // Paste Markers into Track 
      sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Paste'], });
      
      1. JJack Byrne @Jack_Byrne
          2023-09-21 13:30:22.900Z

          Just cutting them over to the track markers hadn't occurred to me! For some reason I just assumed that it wouldn't work, that'll be real handy.