Location of the Flashing Text Cursor on the Screen?

Is there a way in KM to get the pixel location of the flashing text cursor on the screen? As far as I can tell there are either 0 or 1 apps that can contain a cursor at any given time, and it appears to be only the active app, which can have a flashing cursor.

I'm guessing that, if it's even possible, it may require AppleScript or JavaScript, but I'm not much good with either.

Common sense tells me that this information is known to MacOS, but MacOS may not share this information with an API to any app. So solving this may require accessing the AppleScript dictionary of each app, rather than a system-wide solution.

I've googled this question without much success.


There's no easy way to do this.

Not all apps have AppleScript dictionaries – and those that do usually don't manage the text insertion point (a notable exception being BBEdit).

Sometimes you can get more information than expected with System Events (AppleScript UI-Scripting), but that's not always consistent either.


Thanks. I was pondering this while helping someone solve a problem. But I guess this is a dead end.

Unfortunately... Many people would like that functionality.