No internet connection
  1. Home
  2. How to

Getting track markers to default to show track comments

By Bergatron Music @Bergatron_Music
    2025-04-01 20:15:06.896Z

    Hey SF.

    Sorry in advance for the long explanation below! I have created a script that adds a track marker to a selected track and another script that toggles the track marker comments "on". Each of these take up their own button on my deck. My goal here was to combine the two into one script so I only need one button that does all the things. That script is pasted below.

    Where my script is not working the way I want it to is the toggling "on" of the track comments. The first time I run it, it works perfectly since the track marker comments default is "off". The next time I run it, it toggles the comments "off" again and back to the marker name. I'd love for it to toggle the comments to "on" every time. I can always manually switch to the marker name if I want by pressing shift+n.

    In use: When mixing I get change notes via email or text. I copy and paste those change notes into track markers (in the comments section) in ProTools so that I can go through each note one by one knocking out the changes. Having the change note in the track marker comments allows me to look at my markers list and see every marker that says "Change Note: Read Me!" instead of a lengthy title that would be the entire change note that I pasted.

    How can I create a variable that will default any new track marker to "comments" instead of the track marker title?

    Sidebar: I am trying get my clients to use Samply for change notes, in which I would do all of this in the SF Notes App, but unfortunately email and text are my clients preferences, so here I am... LOVE the Notes App though!

    There is probably a better way to do this script, but it works. Any help cleaning it up would definitely be appreciated! I'm trying me best to make things happen on my own before jumping on the forum.

    sf.ui.proTools.appActivateMainWindow();
    
    //Press Keys Command
    sf.keyboard.press({
        keys: "cmd+numpad enter",
    });
    
    //Wait For Element to Appear
    sf.ui.proTools.newMemoryLocationDialog.elementWaitFor({
        waitType: "Appear",
    });
    
    //Click UI Element in script form: Use the "Pick" button (up top)
    sf.ui.proTools.newMemoryLocationDialog
    
    //Type Text
    sf.keyboard.type({
        text: "Change Note: Read Me!",
    });
    
    //Press Keys Command
    sf.keyboard.press({
        keys: "tab",
    });
    
    //Press Keys Command
    sf.keyboard.press({
        keys: "tab",
    });
    
    //Press Keys Command to paste note
    sf.keyboard.press({
        keys: "cmd+v",
    });
    
    //Press Keys Command to close window
    sf.keyboard.press({
        keys: "enter",
    });
    
    //Wait For Element to Disappear
    sf.ui.proTools.newMemoryLocationDialog.elementWaitFor({
        waitType: "Disappear",
    });
    
    
    //Toggle Track Comments "On"
    sf.keyboard.press({
        keys: "shift+n",
    });
    Solved in post #11, click to view
    • 11 replies
    1. Chris Shaw @Chris_Shaw2025-04-01 21:54:41.506Z2025-04-03 05:03:48.921Z

      Try this.
      It will create a track marker on the selected track at the insertion point, set the name to "Change Note: Read Me!", paste the contents of the clipboard to the comments, then ensure that the comments are showing on the track rather than the marker name.

      sf.ui.proTools.appActivateMainWindow()
      
      // Ensure marker controls are showing
      const markerControlMenuPath = ["View", "Edit Window Views", "Marker Controls"]
      
      //@ts-ignore
      const areMarkerControlsVisible = sf.ui.proTools.getMenuItem(...markerControlMenuPath).isMenuChecked
      
      if (!areMarkerControlsVisible) sf.ui.proTools.menuClick({ menuPath: markerControlMenuPath })
      
      // Get Comment Toggle button
      const markersViewGroup = sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Markers View").first;
      const commentToggleButton = markersViewGroup.buttons.whoseTitle.is("Prioritize Marker Name vs Comment").first;
      
      // Get comment toggle button state
      const isCommentToggleButtonOff = commentToggleButton.value.value == "off"
      
      // Gather memory location info
      const markerStartTime = sf.app.proTools.getTimelineSelection().inTime;
      
      const tracks = sf.app.proTools.tracks.invalidate().allItems;
      
      const notes = sf.clipboard.getText().text;
      
      const selectedTrack = tracks.find(t => t.isSelected)
      
      // Create marker
      sf.app.proTools.createMemoryLocation({
          name: "Change Note: Read Me!",
          comments: notes,
          trackName: selectedTrack.name,
          startTime: markerStartTime
      })
      
      // Toggle marker comments if necessary
      if (isCommentToggleButtonOff) commentToggleButton.elementClick()
      
      1. Bergatron Music @Bergatron_Music
          2025-04-01 22:28:01.775Z

          Hi Chris.

          Thanks for this.

          It's working great on the first track I try it on, but if I try running it on a different track, it stays on "Change Note: Read Me!"

          I've probably done something wrong on my end... Here's the script with your modification:

          sf.ui.proTools.appActivateMainWindow();
          
          //Press Keys Command
          sf.keyboard.press({
              keys: "cmd+numpad enter",
          });
          
          //Wait For Element to Appear
          sf.ui.proTools.newMemoryLocationDialog.elementWaitFor({
              waitType: "Appear",
          });
          
          //Click UI Element in script form: Use the "Pick" button (up top)
          sf.ui.proTools.newMemoryLocationDialog
          
          //Type Text
          sf.keyboard.type({
              text: "Change Note: Read Me!",
          });
          
          //Press Keys Command
          sf.keyboard.press({
              keys: "tab",
          });
          
          //Press Keys Command
          sf.keyboard.press({
              keys: "tab",
          });
          
          //Press Keys Command to paste note
          sf.keyboard.press({
              keys: "cmd+v",
          });
          
          //Press Keys Command to close window
          sf.keyboard.press({
              keys: "enter",
          });
          
          const markersViewGroup = sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Markers View").first;
          const comentToggleButton = markersViewGroup.buttons.whoseTitle.is("Prioritize Marker Name vs Comment").first;
          
          const isCommentToggleButtonOff = comentToggleButton.value.value == "off"
          
          const markerStartTime = sf.app.proTools.getTimelineSelection().inTime;
          
          const tracks = sf.app.proTools.tracks.invalidate().allItems;
          
          const notes = sf.clipboard.getText().text;
          
          const selectedTrack = tracks.find(t => t.isSelected)
          
          sf.app.proTools.createMemoryLocation({
              name: "Change Note: Read Me!",
              comments: notes,
              trackName: selectedTrack.name,
              startTime: markerStartTime
          })
          if (isCommentToggleButtonOff) comentToggleButton.elementClick()
          1. You don't need lines 1-40. Just the script I posted should work.
            It works fine on my system when I switch tracks.

            1. Which version of PT are you running?

              1. Bergatron Music @Bergatron_Music
                  2025-04-01 22:33:24.028Z

                  Ha! I knew it was me. I'll try that now.

                  Ultimate 2024.10.2

                • In reply toChris_Shaw:

                  Actually, you do need line 1 to activate PT.
                  So get rid of 2-40.

                  1. Bergatron Music @Bergatron_Music
                      2025-04-01 22:45:30.618Z2025-04-01 22:54:42.275Z

                      Hey Chris.
                      I deleted all the extra stuff (lines 2-40) and I can't seem to get it to work. I've put a vid link below to show you whats happening. Any thoughts?

                      Here are my full system specs:

                      MacBook Pro M2 Max OS 14.7.4
                      SF v5 10.3
                      ProTools Ultimate 2024.10.2

                      https://drive.google.com/file/d/1NxCQ-XuowvM0zfSLJcJGtXs7J7AkUn0L/view?usp=sharing

                      
                      const markersViewGroup = sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Markers View").first;
                      const comentToggleButton = markersViewGroup.buttons.whoseTitle.is("Prioritize Marker Name vs Comment").first;
                      
                      const isCommentToggleButtonOff = comentToggleButton.value.value == "off"
                      
                      const markerStartTime = sf.app.proTools.getTimelineSelection().inTime;
                      
                      const tracks = sf.app.proTools.tracks.invalidate().allItems;
                      
                      const notes = sf.clipboard.getText().text;
                      
                      const selectedTrack = tracks.find(t => t.isSelected)
                      
                      sf.app.proTools.createMemoryLocation({
                          name: "Change Note: Read Me!",
                          comments: notes,
                          trackName: selectedTrack.name,
                          startTime: markerStartTime
                      })
                      if (isCommentToggleButtonOff) comentToggleButton.elementClick()
                      1. Bergatron Music @Bergatron_Music
                          2025-04-01 22:48:57.962Z

                          When I paste the script in this thread, it's not showing line 1. Its definitely copying from line 1. Here's the screenshot:

                          1. Your track marker controls aren't showing in the edit window.

                            I edited the code above to ensure that they are showing.

                            1. ReplySolution
                              1. Bergatron Music @Bergatron_Music
                                  2025-04-01 23:08:44.450Z

                                  Thank you Chris!

                                  I knew I was messing it up somehow! This works perfectly