No internet connection
  1. Home
  2. How to

Script to add marker to specific track

By Sam Ada @Sam_Ada
    2023-10-09 17:53:30.058Z

    Hey Peeps

    I'm having an issue with this code I adapted from this post
    Pro Tools 2023.6 - "Target Track for Markers" button #post-3

    function selectTrackAndMarkerTarget({ name }) {
        const track = sf.ui.proTools.trackGetByName({ name }).track;
        const trackMarkerTargetButton = track.groups.whoseTitle.is("Markers View").first
            .buttons.whoseTitle.is("Add Marker").first;
    
        track.trackSelect();
        if (trackMarkerTargetButton.exists) trackMarkerTargetButton.elementClick();
    }
    
    selectTrackAndMarkerTarget({ name: "Markers" });
    

    The code seems to work kinda how I would like but unfortunately I don't have the know how to fix it.

    What I really would like is a script to add a marker on a specific track in this case named 'Markers' without selecting the track.

    Also if I can script in a color that would be handy.

    • 0 replies