Hold down Ctrl and open the application?

Ok, this opens the contextual menu successfully on my system:

tell application "System Events"
	set frontApp to name of first process whose frontmost is true
	tell application process frontApp
		try
			set theSelection to value of attribute "AXFocusedUIElement"
			tell theSelection
				set defaultAction to perform action "AXShowMenu"
				if defaultAction is missing value then
					tell (first group whose selected is true) to perform action "AXShowMenu"
				end if
			end tell
		on error errMsg number errNum
			display alert errMsg & return & return & errNum
		end try
	end tell
end tell

Here it is in your macro:

Test Open Dev App.kmmacros (22 KB)

Macro screenshot

1 Like