Getting caret x/y position (NOT cursor)

Hey friends!

Long time user and KM forum lurker, but first time poster here! I'm trying to figure out a way to move my mouse directly over wherever my caret is in my active app/window. Is there some easy applescripty way of doing this that I just can't find online? To better understand my goal, here's what I'm trying to do.

In code editors when something is wrong, you can hover over the error (typically shown as red squiggly lines beneath the problem area) and it'll tell you what's wrong and suggest fixes for it. In the excellent VS code vim plugin you also have the gh command which allows you to navigate to the problem with your keyboard then simulates the 'hover' action tooltip. I want this but everywhere. I have Grammarly installed and it gives suggestions and I want to be able to navigate to the suggestion quickly using the keyboard like normal and then hit a hotkey which will move my cursor to hover over the word my caret is on. Is this possible? I can't think of a good way of doing this other than maybe a click at found image command and have it very fuzzily search for a red underline. That's a really hacky solution though. Any ideas on better ones? Thanks for the help! :slight_smile:

-Mike

It sounds like you actually ARE talking about the cursor, and you'd like the mouse pointer to be positioned at the cursor. This is an age-old problem. It would be nice for countless reasons, but because of how the Mac OS is built, there is no straightforward way of doing it. Otherwise, Peter would have built that functionality into KM long ago.

I doubt that this is possible with KM, or even with AppleScript.
I'd suggest that you submit a feature request to Grammarly to provide keyboard shortcuts for accessing their elements.

bummer, yeah, I was afraid of that. :confused: Well, thanks for the help at least!