Hi all! I'm hoping to get some help with two track titling macros:
1- Make all letters CAPITAL (for example: "Drum Kit" would change to "DRUM KIT")
2- Make only the first letter of each word Capital (for example: "drum kit"/"DRUM KIT" would change to "Drum Kit")
It would be awesome if each macro was un-doable (I have a ALL CAPS macro but it's not un-doable). But, if that's not possible, that's ok b/c these two macro's essentially cancel each other out.
Thank you in advance for any help :)
Matt Friedman @Matt_FriedmanTry this. Included lower case. (It's not un-doable though, but it's faster this way).
titleis "Title Case"/** * Change the case of all selected Pro Tools track names. * * @param {"upper"|"lower"|"title"} caseStyle - Desired case style */ function trackNamesCaseChange(caseStyle = "upper") { sf.app.proTools.tracks.invalidate(); sf.app.proTools.tracks.allItems .filter(t => t.isSelected) .forEach(t => { let newName; switch (caseStyle) { case "lower": newName = t.name.toLowerCase(); break; case "title": newName = t.name .toLowerCase() .replace(/\b\w/g, char => char.toUpperCase()); break; case "upper": default: newName = t.name.toUpperCase(); } if (t.name !== newName) sf.app.proTools.renameTrack({ oldName: t.name, newName }); }); } trackNamesCaseChange("title"); // "upper", "lower", or "title"@Matt_Friedman Works great!! But I am getting an error:
"Names should be different (Capitalize First Letter: Line 28)"
But it's functioning as expected, so ?? haha.
Thank you for your help :)
Matt Friedman @Matt_FriedmanYou could change
sf.app.proTools.renameTrack({ oldName: t.name, newName });To
if (t.name !== newName) sf.app.proTools.renameTrack({ oldName: t.name, newName });