This task can be performed using Text Capture
Simple & convenient OCR tool for macOS
Best product for this task

Text Capture
productivity
Capture text from anywhere - non-selectable text in apps, images, videos, PDFs, or anything on your screen! Simple & convenient OCR tool for macOS 1. Click capture text 2. Select an area on screen with text 3. Paste the text anywhere

What to expect from an ideal product
- Takes a screenshot of any text on your Mac screen with one click
- Turns screenshots into editable text you can copy and paste
- Works on text from photos, PDFs and videos that you normally can't select
- No need to type out text manually from images or documents
- Grabs text from any app or window, even if the text isn't normally selectable