Retrieves the current position of the caret (text insertion point).
CaretFound := CaretGetPos(&OutputVarX, &OutputVarY)
Note: On Linux, foreign-application caret lookup uses AT-SPI; Wayland coordinate normalization also requires a compositor backend which exposes active-window geometry. On macOS, caret lookup uses the Accessibility API and requires Accessibility permission.
Type: VarRef
If omitted, the corresponding value will not be stored. Otherwise, specify references to the output variables in which to store the X and Y coordinates. The retrieved coordinates are relative to the active window's client area unless overridden by using CoordMode or A_CoordModeCaret.
Type: Integer (boolean)
If there is no active window or the caret position cannot be determined, the function returns 0 (false) and the output variables are made blank. The function returns 1 (true) if the system returned a caret position, but this does not necessarily mean a caret is visible.
Any of the output variables may be omitted if the corresponding information is not needed.
Note that some windows (e.g. certain versions of MS Word) report the same caret position regardless of its actual position.