Is there a way to achieve this in Keyboard Maestro?
Found that when I'm typing in slack and I misspell a word, going to my mouse and right clicking that word takes time.
Since slack doesn't have a spell check quick key, I'm wondering if I could program a macro to right click where my cursor is so I don't have to go to my mouse to achieve this.
MealTicketAlex,
Slack is not a native Mac app as it is written in Javascript (whether running as Electron App or in web browser) and the Applescript code provided by noisneil can only work with native Mac app.
To explain technically, the Applescript code by @noisneil is unable to get the AXFocusedUIElement (since Slack is not true native App), hence the error occurs.
tell application "System Events" to set frontApp to name of first process whose frontmost is true
tell application "System Events"
tell application process frontApp
set _selection to value of attribute "AXFocusedUIElement" # <--- _selection become Missing Value
tell _selection to perform action "AXShowMenu"
end tell
end tell