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",
});
- 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()
Bergatron Music @Bergatron_Music
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()
Chris Shaw @Chris_Shaw2025-04-01 22:30:57.863Z
You don't need lines 1-40. Just the script I posted should work.
It works fine on my system when I switch tracks.Chris Shaw @Chris_Shaw2025-04-01 22:32:00.697Z
Which version of PT are you running?
Bergatron Music @Bergatron_Music
Ha! I knew it was me. I'll try that now.
Ultimate 2024.10.2
- In reply toChris_Shaw⬆:
Chris Shaw @Chris_Shaw2025-04-01 22:33:29.916Z
Actually, you do need line 1 to activate PT.
So get rid of 2-40.Bergatron Music @Bergatron_Music
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.2https://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()
Bergatron Music @Bergatron_Music
When I paste the script in this thread, it's not showing line 1. Its definitely copying from line 1. Here's the screenshot:
Chris Shaw @Chris_Shaw2025-04-01 23:03:30.727Z
Your track marker controls aren't showing in the edit window.
I edited the code above to ensure that they are showing.
Chris Shaw @Chris_Shaw2025-04-01 23:04:30.079Z
New code in this comment:
Getting track markers to default to show track comments #post-2Bergatron Music @Bergatron_Music
Thank you Chris!
I knew I was messing it up somehow! This works perfectly