No internet connection
  1. Home
  2. How to

Pro Tools Create A Marker With Location Number In Title

By Lance Crowder @Lance_Crowder
    2024-09-18 23:09:10.168Z

    I've made a macro in the past that could copy and paste the location number in the name of the marker, but with the newer version of markers in pro tools I there's no way to command c to copy it. So I'm unsure if there's a way to actually copy that number and paste it in the text field.

    An example would be: it's my first marker so it would be labeled "1. intro" and My 2nd marker would be labeled "2. verse 1" or "2. hook". I'm able to click the button on my deck that has the name of the marker I want and then paste the number marker in front of it. If that makes sense.

    My biggest issue is really just finding a way to copy and paste that number into the text field now.

    Solved in post #2, click to view
    • 11 replies
    1. D
      danielkassulke @danielkassulke
        2024-09-19 10:50:00.568Z2024-09-19 21:06:11.165Z

        Hey Lance,

        I got heaps of help for this from the forum:

        function newMemoryLocation(name, startTime) {
            sf.app.proTools.createMemoryLocation({
                name,
                startTime,
                colorIndex: 1
            });
        }
        
        function main() {
            sf.ui.proTools.appActivateMainWindow();
        
            // Get Memory Locations
            const memLocs = sf.app.proTools.memoryLocations.invalidate().allItems.map(memLoc => ({ number: memLoc.number, name: memLoc.name }));
        
            const markerName = "HELLO WORLD";
            const customMarkers = memLocs.filter(memLoc => memLoc.name.includes(markerName));
        
            // Read next marker number
            const nextMarkerNumber = customMarkers.length === 0
                ? 1
                : Math.max(...customMarkers.map(memLoc => parseInt(memLoc.name.split(markerName)[1] || "0", 10))) + 1;
        
            // Position of marker
            const mainCounterValue = sf.ui.proTools.mainWindow.counterDisplay.textFields.whoseTitle.is("Main Counter").first.value.value;
        
            const newMarkerName = `${memLocs.length + 1}. ${markerName} ${nextMarkerNumber}`;
            newMemoryLocation(newMarkerName, mainCounterValue);
        }
        
        main();
        

        Specify your marker name in line 15. The great thing with this script is that it reads the memory location table, and it looks for previous instances of the marker name, so if you set the marker name to 'verse', it will automatically name the first one 'verse 1', the second one 'verse 2' etc. I have a lot of these made up from templates.

        ReplySolution
        1. JJonathan Johnson @Jonathan_Johnson
            2026-03-22 03:13:24.366Z

            Hey, looking for a Script to spot and drop memory, location flags with predetermined name, and specific marker number.

            I work on a weekly show that has several live songs and for session prep I want to be able to drop marker such as ‘verse one song two marker 10’ ‘ marker for song C bridge memory locator 23’ ect..

            I already have a set of macros to recall specific memory loccaters to jump around the session quickly, but want a way to quickly create memory locations with a predetermined name and number

            1. Ddanielkassulke @danielkassulke
                2026-03-22 03:43:28.810Z

                Hey Jonathan,

                You'd have to customise the script for your needs. The way I use automated markers is by using the name like this: "1. Marker Name". So for your first example, would "10. Song 2 Verse 1" work? Also in general I abbreviate as much as possible to make them easier to read on a crowded timeline, i.e. "10. S2 V1" It would be easier if you could provide a more strict naming convention that you follow every time.

                1. JJonathan Johnson @Jonathan_Johnson
                    2026-03-22 17:02:23.166Z

                    sure, makes sense, will give it a go. THANKS

                    1. In reply todanielkassulke:
                      JJonathan Johnson @Jonathan_Johnson
                        2026-03-22 23:30:30.238Z

                        What if I wanted the makers to start wit a specific number,

                        so lets say" V 1 A, Marker 40

                        where would I alter the code to start with a Specific marker number?

                        1. In reply todanielkassulke:
                          JJonathan Johnson @Jonathan_Johnson
                            2026-03-22 23:50:23.186Z

                            Let me clarify better, what
                            I’m looking for.

                            It’s great and very clever that your script seems to incrementally add number so you could press it multiple times and have the numbers added

                            I’m actually not that interested in that

                            So your script gets me half the way there, but I’m getting confused onto how to add the defined marker numbers.

                            I’m looking for a script that when executed would create a memory location that says ‘V 1 A’ and give it the marker number 40.

                            I already have a script that will recall marker 40.

                            And then next want to make a button next to it that would be called ‘C 1 a ‘ with marker 41

                            The next would be ‘v 2 a’ with marker 42

                            Ect..

                            Eventually, I would have a ‘v 1 B’ because lest say the Pro Tools session had four songs in it….

                            Thanks for your Help!

                            1. Ddanielkassulke @danielkassulke
                                2026-03-23 01:27:20.586Z

                                Ahhh - that's a lot easier and more predictable. Here's an example of how to create marker number 40:

                                const playheadPosition = sf.ui.proTools.sfx.mainWindow.counterDisplay.textFields.whoseTitle.is("Main Counter").first.value.value;
                                
                                sf.app.proTools.createMemoryLocation({
                                    colorIndex: 0,
                                    startTime: playheadPosition,
                                    name: "V 1 A",
                                    number: 40,
                                    });
                                
                                1. JJonathan Johnson @Jonathan_Johnson
                                    2026-03-23 01:53:54.857Z

                                    THANSK ITS PERFECT!

                                    this forum is GREAT!

                          • L
                            In reply toLance_Crowder:
                            Lance Crowder @Lance_Crowder
                              2024-09-19 18:10:54.744Z

                              Thanks so much!

                              Is there potentially something above that first line? Line 6 is saying it's broken I believe. And nothing happens when I activate it. I'm still really new to the actual script side of things so I'm not sure what I could add to close it.

                              1. Ddanielkassulke @danielkassulke
                                  2024-09-19 20:56:44.422Z

                                  Hi Lance - yes, sorry. I had omitted a line break. Should be working now!

                                • L
                                  In reply toLance_Crowder:
                                  Lance Crowder @Lance_Crowder
                                    2024-09-19 21:30:40.504Z

                                    Thanks so much!! Works great.