Not just OCR, but object recognition - just has to be smart enough to read the window's title bar to tag the shot by applications present in it and by document name when some are visible.
Google Photos does it for you. Very handy a few years ago, I took a picture of the private wifi password backstage at a bar I used to work at, lost the saved login when I swapped phones. Searched my photos for "Thunderbird" and boom... a picture of text saying "Thunderbird private WIFI password".
I'm a bit disappointed that this doesn't work in Apple Photos. The app does a fairly good job at recognizing photos and doing OCR, but you can't search the text.