Autocomplete inside your own text view is a solved problem. You own the NSTextView , you know where the caret is, and you decide what Tab does. Autocomplete inside someone else's text field, in an app you did not write, is a different job. You don't own the text, the caret, or the Tab key. You borrow all three through macOS Accessibility, and each app lends them a little differently.
We build DraftKey, a Mac app that suggests the rest of your sentence as you type and adds it when you press Tab. This post is about the plumbing behind that kind of feature. For the general mechanics I'm citing Apple's public documentation. For what we actually ran into, I'm citing our own public release notes: 52 tagged releases on GitHub, from 0.1.1 on September 20 to 0.1.62 on November 11, 2026. When I'm describing the macOS API surface in general rather than DraftKey's code, I'll say so.
Step 0: you need permission before you can see anything
A Mac app can't read another app's text fields by default.…