Toggle Between Automation Modes
By Daniel Knobler @Daniel_Knobler
Hello,
Does anyone have a command to toggle between two automation modes for selected tracks? Preferably toggle between READ AND TOUCH.
Thanks!
- Chris Shaw @Chris_Shaw2022-08-01 22:06:40.153Z2022-08-01 22:20:15.717Z
Sorry for the late reply.
Try this.
Just changeprimaryMode
andsecondaryMode
to whatever two automation modes you want to toggle between.// Check if tracks are selected if (sf.ui.proTools.selectedTrackCount == 0) { sf.interaction.notify({ title: "Toggle Automation Mode", message: "No Tracks selected" }); throw 0 }; // possible auto modes: read - touch - latch - touch/latch - write const primaryMode = "read" const secondaryMode = "touch" //Read automation mode of first selected track const currentAutoMode = sf.ui.proTools.selectedTrack.automationModeButton.value.invalidate().value //Determine which mode to switch to const newMode = (currentAutoMode.includes(primaryMode)) ? secondaryMode : primaryMode // Set automation mode for all selected tracks sf.ui.proTools.selectedTrack.automationModeSet({ automationModeName: newMode, trackTargetMode: "SelectedTracks", });
Chris Shaw @Chris_Shaw2022-08-01 22:13:57.717Z
You should probably have another trigger to toggle trim on / off:
// Check if tracks are selected if (sf.ui.proTools.selectedTrackCount == 0) { sf.interaction.notify({ title: "Toggle Automation Mode", message: "No Tracks selected" }); throw 0 }; // Toggle trim on/off sf.ui.proTools.selectedTrack.automationModeSet({ automationModeName: "trim", trackTargetMode: "SelectedTracks", });