This is an imperfect solution due to Inbox AI being a sandboxed app on the AppStore, it cannot be improved while remaining on the AppStore.
Attempts to get the selected text from the screen. It does this by simulating a CMD+C keypress and reading the result of the clipboard. If this fails, or is empty, the result will be "NO SELECTED TEXT FOUND".