Toggle Playback Pro Tools and Tidal
By Chad Wahlbrink @Chad2021-09-27 14:31:51.647Z2021-09-27 18:56:05.444Z
I wanted a script that could toggle the playback from Pro Tools to Tidal for referencing while mixing. This is my current solution! Thanks to @Chris_Shaw for the help.
const tidalApp = sf.ui.app('com.tidal.desktop')
// Determine if Play or Pause exists in Playback menu
// This uses a ternary operator: If "Playback" exists then it will return "Play" otherwise it returns "Pause"
// ↓ Thanks to Chris Shaw for this ↓
var playOrPause = (tidalApp.getMenuItem("Playback", "Play").exists) ? "Play" : "Pause";
if (sf.ui.proTools.isPlaying) {
// Stop Pro Tools and Play Tidal
sf.ui.proTools.mainWindow.transportViewCluster.transportButtons.stopButton.elementClick();
tidalApp.menuClick({
menuPath: ["Playback", "Play"]
})
} else if (playOrPause == "Play") {
// Play Tidal if neither is playing
tidalApp.menuClick({
menuPath: ["Playback", "Play"]
})
} else {
// Pause Tidal and Play Pro Tools
tidalApp.menuClick({
menuPath: ["Playback", "Pause"]
})
sf.ui.proTools.mainWindow.transportViewCluster.transportButtons.playButton.elementClick();
}
Linked from: