After installing snapit, run it. You can see the following interface:
Select Text From A Window, then switch to the window you want to capture, press the Ctrl Shift P key button.
The text in the window is captured in the following interface.
Snapit captures various texts in dialogs, browsers, and software interfaces.