How to Toggle Zoom if it's already active
By alex alcanjim @alex_alcanjim
Hi all,
Just looking to improve my zoom workflow on Pro Tools using "Zoom Toggle" tool.

I just want to create a macro that active "Zoom Toggle", but I need something else. I want this macro to check if "Zoom Toggle" is active or not before run the macro.
Then, if "Zoom Toggle" is active, I want to de-activate it and, then, active it again. And if it is disable, just active it.
Any idea about how to create this script?
Thanks in advance for the help!
- Christian Scheuer @chrscheuer2020-09-24 14:32:06.651Z
Something like this should work :)
const zoomToggleButton = sf.ui.proTools.mainWindow.cursorToolCluster.zoomToggleButton; let isZoomToggleOn = zoomToggleButton.value.invalidate().value === 'Selected'; if (isZoomToggleOn) { zoomToggleButton.elementClick(); zoomToggleButton.elementClick(); } else { zoomToggleButton.elementClick(); }