Is there a way to get access to the comments boxes in Pro Tools using SF without double clicking on the track name and then using a series of CMD+Right Arrow moves?
I'd like to be able to copy Track names to comments boxes for selected tracks, for an entire session, and also delete all text written in comments boxes too.
Please let me know if it's possible! Thanks!
- Christian Scheuer @chrscheuer2019-09-18 09:25:07.350Z
This should do it:
function setComment(trackHeader, text) { var commentsField = trackHeader.textFields.whoseTitle.startsWith('Comments').first; commentsField.mouseClickElement(); sf.keyboard.press({ keys: 'cmd+a' }); sf.keyboard.type({ text: text }); sf.keyboard.press({ keys: 'return' }); } function setCommentsToTrackNames() { var tracks = sf.ui.proTools.selectedTracks.trackHeaders; for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; setComment(track, track.normalizedTrackName); } } setCommentsToTrackNames();
Chris Shaw @Chris_Shaw2021-01-19 23:27:17.446Z
This is insanely useful for this archival project I working on.
Thanks- In reply tochrscheuer⬆:
Chris Shaw @Chris_Shaw2021-01-28 18:11:18.412Z2021-02-02 22:20:25.877Z
A slightly more robust version that makes sure that the selected track is scrolled into view (otherwise it fails) and opens and closes the comments field if not initially visable:
function setComment(trackHeader, text) { var commentsField = trackHeader.textFields.whoseTitle.startsWith('Comments').first; commentsField.mouseClickElement(); sf.keyboard.press({ keys: 'cmd+a' }); sf.keyboard.type({ text: text }); sf.keyboard.press({ keys: 'return' }); } function setCommentsToTrackNames() { var trackNames = sf.ui.proTools.selectedTrackNames var tracks = sf.ui.proTools.selectedTracks.trackHeaders; for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; sf.ui.proTools.trackSelectByName({ names: [trackNames[i]] }); sf.ui.proTools.selectedTrack.trackScrollToView({}); setComment(track, track.normalizedTrackName); } } sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); let areCommentsVisible = sf.ui.proTools.getMenuItem("View", "Edit Window Views", "Comments").isMenuChecked if (!areCommentsVisible) { sf.ui.proTools.menuClick({ menuPath: ["View", "Edit Window Views", "Comments"], }) } setCommentsToTrackNames(); if (!areCommentsVisible) { sf.ui.proTools.menuClick({ menuPath: ["View", "Edit Window Views", "Comments"], }) }
Chris Shaw @Chris_Shaw2021-02-02 22:20:58.690Z
Revised : Added
sf.ui.proTools.invalidate();
- NNenad Simsic @Nenad_Simsic
With PT 2023.6 this script does not work anymore! Is there any chance to have a look into this?
thanx, Nenad
- In reply tochrscheuer⬆:MMatt Friedman @Matt_Friedman
This doesn't seem to work anymore. Looks like SF can no longer click on the Comments Field??? (PT 2023.6)
Christian Scheuer @chrscheuer2023-11-07 15:25:13.460Z
cc @Kitch - it's likely you'll need to add a slight offset to the
mouseClickElement
call to make the mouse click happen in the right location.- MMatt Friedman @Matt_Friedman
I actually found solution in another thread here just changing
commentsField.mouseClickElement()
tocommentsField.elementClick()
- AIn reply toGraham_Archer⬆:Andrés Giraldo @Andres_Giraldo
What about if you want to do it the other way around? I mean copying the comments to the track name? What should change in the code?
Thanks!
- RRyan @Ryno
I'd love this "track names to comments" script to work, I came here to request it and it's not working in the latest builds of Pro Tools
- JIn reply toGraham_Archer⬆:Judson Crane @Judson_Crane
wondering if there is a new script for this function that is compatible with current version of PT? Thanks!
Chris Shaw @Chris_Shaw2025-09-07 17:20:09.555Z2025-09-07 17:39:42.399Z
This should do it.
If alt/option is held while triggering this script it will clear all comments from selected tracks:/** * Sets comments on selected tracks to match their track names. * If Alt is held, comments will be cleared instead. * * @param {boolean} hasAlt - Whether the Alt key is held down. */ function setComments(hasAlt) { // Ensure Pro Tools is active and refreshed sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); // Get selected tracks const selectedTracks = sf.app.proTools.tracks.invalidate().allItems.filter(t => t.isSelected); if (!selectedTracks.length) throw "No tracks selected"; // Scroll first track into view and open rename window const firstTrack = selectedTracks[0]; const firstTrackHeader = sf.ui.proTools.trackGetByName({ name: firstTrack.name }).track; sf.ui.proTools.trackSelectByName({ names: [firstTrack.name] }); sf.ui.proTools.selectedTrack.trackScrollToView(); firstTrackHeader.titleButton.mouseClickElement({ clickCount: 2 }); // Wait for the rename window sf.ui.proTools.windows.whoseTitle.is(firstTrack.name).first.elementWaitFor(); const renameWindow = sf.ui.proTools.focusedWindow.invalidate(); // ───────────────────────────── // Map text fields and buttons // ───────────────────────────── const [trackNameField, commentsField] = renameWindow.textFields.map(x => x); const [okBtn, , , nextBtn] = renameWindow.buttons.map(x => x); // Helper to sync or clear comments function updateComments() { if (hasAlt) { commentsField.elementSetTextFieldWithAreaValue({ value: '' }); return; } while (trackNameField.value.invalidate().value !== commentsField.value.invalidate().value) { commentsField.elementSetTextFieldWithAreaValue({ value: trackNameField.value.invalidate().value }); } } // Process each track selectedTracks.forEach((track, i) => { updateComments(); const isLast = i === selectedTracks.length - 1; (isLast ? okBtn : nextBtn).elementClick(); }); // Reselect all processed tracks sf.app.proTools.selectTracksByName({ trackNames: selectedTracks.map(t => t.name) }); // ───────────────────────────── // Final notification // ───────────────────────────── sf.interaction.notify({ title: "Update Track Comments", message: hasAlt ? "Comments cleared on selected tracks." : "Comments set to track names.", keepAliveMs: 3000 }); } // Entry point setComments(event.keyboardState.hasAlt);
Chris Shaw @Chris_Shaw2025-09-07 17:22:53.046Z2025-09-07 17:58:59.671Z
This is a refactor of @samuel_henriques excellent script from this thread:
Copy track name and paste to PT scribble strip...
I updated it to take advantage of some of the newer SF / PT SDK commands