Hey I am brand new to this application and thought this would help me spell check my sentence quicker.
Unfortunately on the Mac there is no way in general to get the location of the keyboard insertion point.
You will likely need to find an alternative way to accomplish this. I didn’t immediately see what menu command you wanted to select in the contextual menu - what application are you using and what menu command are you wanting to select?
I wonder if you could stop the insertion point from blinking (such as: https://apple.stackexchange.com/questions/191087/how-to-stop-cursor-blinking-in-pages) and then use the “click at found image” feature in KM, where you would paste an image of the cursor. Then tell KM to find the cursor and right-click on it.
I very much doubt you will be able to find the cursor on the page reliably even if it is not blinking.
Welcome to Keyboard Maestro! I have no doubt that you will find it one of the best Mac automation tools available.
I understand your use case very well, and I too have tried to find a solution. The best I have found is to place the mouse cursor over the word you want to spellcheck, and trigger the macro. I've done this so often that it is now a muscle memory.
Here's my macro, which I trigger with OPT-S. BTW, in case you don't know it, once the spell checker has displayed the replacement word, hitting the SPACEBAR will accept the word.
###MACRO: @UI Spelling -- Check Current Word, and Auto-Select First Suggestion
~~~ VER: 1.0 2017-06-14 ~~~
@UI Spelling -- Check Current Word- and Auto-Select First Suggestion.kmmacros (2.7 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
####How To Use
- Place mouse cursor over word
- Trigger this macro
- Press SPACE to accept selected correction
- Press DownArrow key to choose other corrections
- Press ESC to cancel
Similar to what @Steve_Solari said above I've been playing around with the found image feature. Rather than looking for the cursor though I set it to look for the red dotted underline that indicates a misspelled word.
- Not sure how the image matching algorithm is working behind the scenes so it's unclear how to create an image optimized to match the misspelling underline.
- Background color will have an effect on image matching which can cause failures (i.e. doesn't match on light but matches on dark background).
- It's probably best to screen capture your own image so that the resolution of the dots matches your screen.