Click in <modifier key>; Voice Commands

tell application “System Events”
set theName to name of the first process whose frontmost is true
end tell

tell application “System Events”
tell process theName

key down 59 -- (???)
key up 59

end tell
end tell

Big Sur has brought new voice commands that associate mouse click with modifier keys.

Click in .

If the modifier key is Control, the menu associated with the right mouse button appears (popup menu).

In an attempt to reproduce that voice command I wrote those lines above, unsuccessfully, in a script.

I appreciate any help.

I am on Catalina. At least on Catalina, Voice Over is background only process. So, GUI scripting (clicks, keystrokes, key codes) doesn’t make sense with it on the Catalina. I can only show to you proper way to hold control key, how to quit and activate Voice over when “Enable Voice Over” in the System Preferences already is enabled:

activate application "DictationIM" -- optional

tell application "System Events"
	key down control
	delay 1
	key up control
end tell

delay 10 -- optonal
quit application "DictationIM" -- optional

Hello, KniazidisR.

Thank you for your time and for your remarks. :slight_smile: