No internet connection
  1. Home
  2. How to

Command click UI element

By Danny @Danny_van_Spreuwel
    2020-07-30 17:51:21.839Z

    How do I click an UI element with the command key pressed down?

    I tried the "Set Keyboard Modifier State" action to enable but it didn't affect the elementClick.

    sf.keyboard.modifiers({
        isCommand: true,
    });
    
    sf.ui.proTools.automationWindow.buttons.whoseTitle.is('Enable AutoJoin Mode').first.elementClick();
    
    Solved in post #3, click to view
    • 2 replies
    1. Hi Danny

      To simulate a keyboard press held down while clicking on a UI element, you also need to simulate the mouse part.
      Click UI Element uses UI Automation, but Pro Tools doesn't register modifier keys when we use UI automation.

      To simulate a mouse click relative to a UI element, (while holding down a modifier key or not), use the "Mouse Click Relative to UI Element" action.
      Use the "Hold Command" property set to "Yes" to make it work.

      1. Danny @Danny_van_Spreuwel
          2020-07-30 17:58:31.964Z

          Yes, that's it. It works now. The command key was hidden behind the gear icon.

          Reply1 LikeSolution