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