No internet connection
  1. Home
  2. How to

How to I create a macro to Control + Option + Command and click on a UI Element?

By Mike LaFerla @Mike_LaFerla
    2023-09-27 23:20:36.679Z

    For those of you that use zoom toggle in Pro Tools. I am trying to create a macro that will essentially 3finger (control+opt+com) hold and then click on Zoom Toggle when it is active. That way it leaves the current zoom setting while deactivating zoom toggle.

    I have tried using 2 macros without success.
    -"Set Keyboard Modifier State"
    -- Hold Control - YES
    -- Hold Option - YES
    -- Hold Command - YES

    The "click UI element" part is working but it is not engaging the modifiers.

    I feel like I am missing something simple here....

    Thanks!

    Solved in post #2, click to view
    • 4 replies
    1. Nathan Salefski @nathansalefski
        2023-09-28 00:51:19.077Z

        Hey Mike,

        @chrscheuer explains it here Command click UI element #post-2 but this should do the trick for ya:

        sf.ui.proTools.appActivateMainWindow();
        
        sf.ui.proTools.mainWindow.invalidate();
        
        sf.ui.proTools.mainWindow.cursorToolCluster.buttons.whoseTitle.is("Zoom Toggle").first.mouseClickElement({
            relativePosition: {"x":15,"y":10},
            isOption: true,
            isControl: true,
            isCommand: true,
        });
        
        ReplySolution
        1. Chad Wahlbrink @Chad2023-09-28 00:53:58.253Z

          @nathansalefski is right on the nose!

          @Mike_LaFerla, if you want to do it with a macro, you can use the "Mouse Click Relative to UI Element" and click the "Gear" button to add the modifiers.

          1. MMike LaFerla @Mike_LaFerla
              2023-09-28 00:56:04.065Z

              @nathansalefski - Thanks so much for this! Works like a charm!

          2. In reply toMike_LaFerla:
            Chad Wahlbrink @Chad2023-09-28 14:26:22.168Z

            Another quick note, @Mike_LaFerla ! There is a built-in Pro Tools Key Command for "cancel zoom toggle and remain at same zoom level": ⇧⌥E