NOTE: Seems like there is a bug in macOS 14.5 and the screenshot capture Shortcuts action isn’t working anymore. Until Apple fixes it, I have posted a temporary fix in a Patreon video (but I have made it available to everyone, not just supporters).
You can create a Shortcut that will allow you to capture a portion of your screen, and then the text from that image will be extracted and placed in the clipboard. This is useful where you can't normally select and copy text from websites and apps.
Video Summary
In This Tutorial
How to build a Shortcut in macOS Monterey that captures a selected portion of the screen and extracts the text from that image to the Clipboard, useful for websites and apps where text cannot normally be selected and copied.
Intro
- A simple Shortcut created in the Shortcuts app can capture any portion of the screen and copy whatever text appears there, even text that is part of an image or in an app that does not allow copying, to the Clipboard.
Building the Shortcut
- In the Shortcuts app a new shortcut is started with the Plus button, and the first action is Take Screenshot, which is changed from a full screenshot to an Interactive Screenshot by going into Show More and switching from Window to Custom so an area can be selected with crosshairs.
- The Extract Text From Image action is added next and is automatically linked to the screenshot result, so it pulls the text from whatever area was captured.
- When more than one line is captured the text comes back as a List with each line as a separate item, so a Combine Text action is added with a New Line separator (spaces work well for paragraphs) to join the lines back into a single block of text.
- A final Copy to Clipboard action sends the combined text to the Clipboard so the shortcut can be run outside of the Shortcuts app and the result pasted wherever needed.
Naming and Running It
- The shortcut is named (for example, Screen Capture Text to Clipboard) and can be pinned to the Menu Bar so it can be run after quitting or hiding the Shortcuts app.
- It is typically used on a webpage that blocks selecting text, on an image whose text is really pixels, or in apps such as the App Store where text cannot be copied, capturing the text and pasting it into an app like TextEdit.
Adding a Keyboard Shortcut
- Selecting Use As Quick Action and assigning a keyboard shortcut such as Command Shift 7 (which fits alongside the built-in Command Shift 3 through 6 capture commands) makes it available in the Services Menu and runnable with a keypress.
- This makes it easy to grab uncopyable text from places like System Preferences panes, tables where data must otherwise be exported, or song lists in the Music app, after which the pasted text can be reformatted as needed.
Use on iPhone and iPad
- The shortcut does not work the same way on iPhone or iPad because there is no interactive screenshot, so it captures the whole screen and returns all the text it can find, which may still be sufficient depending on the need.
Summary
A short Shortcut combining an interactive screenshot, Extract Text From Image, Combine Text, and Copy to Clipboard provides a fast way to pull text from anywhere on the screen, and assigning it a keyboard shortcut makes it especially handy for websites, images, and apps where text cannot normally be selected and copied.
Video Transcript
Hi, this is Gary with MacMost.com. Today let me show you how to create a shortcut in macOS Monterey to capture text from anywhere on your screen.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about the Patreon Campaign. Join us and get exclusive content and course discounts.
So here's a very simple shortcut that you can create in the Shortcuts App that will allow you to capture any portion of the screen. Whatever text is there, even if it's part of an image or in some app where you can't copy text, that text will then be copied to the Clipboard.
So I'm in the Shortcuts App here in macOS Monterey. I'm going to click on the Plus button to create a new shortcut. I'm going to start off here by doing a screen capture. So let's just search for Capture here and there's Take Screenshot. I'm going to double click to add that. Then where it says take full screenshot I want to change that to Take Interactive Screenshot. This will allow me to select an area on the screen instead of capturing the entire screen. First I have to go into Show More and change from Window to Custom. So now this lets me select an area. So if I actually try this out by using the Play button here you could see it gives me the crosshairs and I can select something. Then you can see it captures that and puts that in an image.
Now let's search for a way to get the text from the image. So we can see here if we just search for text we can find one here that is Extract Text From Image. So we double click on that to add that next. It will automatically link the results of the first action to the second action. So it will extract text from screenshot. So now let's give it a try. I'll use Plus here. I'll grab this bit of text that's on the screen and you could see the result is actually text taken from the screenshot in the first set.
Now let's take a look at what happens if we run this and select more than one line of text. I'm actually going to select the text here on the right side of the screen. I have several lines of text. You could see it only seems to show the first line. But in fact if you look closely it says Page one of five. I can use the arrow here to go through the different lines. If I switch to List View you could see it took every line of text and placed it in a separate item in what's called a List, an array of elements. So I actually have five different elements that have been captured by Extract Text.
Let's look over here and we can see that under text there's also combined text. If you look at the info for it we see it joins the text together, inserting a separator between each join. Let's try that. I'm going to double click there to add it and it will combine text from the image. It's going to correctly say, okay I'm going to grab the results of the last action. What am I going to use to combine these? I can use New Line, Spaces, or any Custom characters. Spaces might work great if you're capturing paragraphs of text. But let's just use New Lines here. Now if we run this and I try to capture some text that's in several lines like this, it's actually going to combine them together putting a new line between each. So there's no List here. Just some text with each line of text on a separate line here.
Now to finish this off let's have this go to the Clipboard because we're not going to be running this in Shortcuts. We're going to be running this outside of Shortcuts and we just want to simply capture the text and then paste it into whatever we're doing. So let's just search for Clip and I can see Copy to Clipboard. Use that. Now it's going to copy the combined text to the Clipboard. So notice I have lines for each one of these connecting them. So it automatically did that. I could always click here and clear this out. Click here again and then do things like select Magic Variable, click on Combine Text, and that will create the line there. But because I did it nice and cleanly, building each step one after the other, it added the lines automatically.
So now let's give this a try. I'm going to run it and I'm going to capture something. Let's capture this text here on the screen. You could see it gives the output here but most importantly it copied it to the Clipboard. So let's go take a look here. I'm going to run TextEdit and then I'll use Command V for paste and you could see I get the text there. Let's give this a name. We'll call this Screen Capture Text to Clipboard. Then let's decide how we're going to use this.
To start I'm going to click here and say that I want to Pin it in the Menu Bar. That will make it appear here. So I could do that. Now you can see it appears there. So now I can Quit or Hide Shortcuts and I can actually use this. Typically you may use this on a webpage that doesn't seem to allow you to select and copy text or with an image that has text in it but it's not actual text. It's actually pixels in the image. Sometimes you have an app like here in The App Store where you can't copy the text. There's no way to select this text and copy it. So we can use our Shortcut for that. Go to the Menu here. Screen Capture Text to Clipboard. Then select this text like that. Now if I switch to TextEdit and paste you can see it pasted the text in.
Let's make it even easier to use. I'm going to select Use As Quick Action here and then I'm going to add a keyboard shortcut. Notice it checks off Services Menu so it will appear in the Menu Bar now. You want to make sure that stays checked. I'm going to run it with Command Shift 7 which makes sense since Command Shift 3, 4, 5, 6 are different kinds of screen capture. So we'll make Command Shift 7 screen capture and then copy the text to the Clipboard.
So here's another place where you can't copy text. Let's say you go into System Preferences and you go into one of the preference panes here and a lot of time there's text like this. You may want to copy and paste it to a help document or something and you can't copy it. So we could click here and choose this. But we also have in the Services Menu the ability to do it right here. You can see there's the keyboard shortcut. So let's use the keyboard shortcut and now I can select it. If I switch to TextEdit, paste, there it is!
You could use this for all sorts of things. As I said before a lot of times webpages restrict what you can copy from them so this is useful there. Sometimes selecting something isn't very easy like if you want to get data from this table you may have to use their export function or something like that. But if you want to quickly grab some data like this you could use your keyboard shortcut here and then just grab what you want like that. Now I'll paste this into TextEdit. I can just do a little bit of work reformatting that adding tabs, commas, whatever I want to get what I want without having to struggle with website export or copy functions. Or any app where there's text that you want to copy but there's no real obvious way to get the data as just text. Like here in the Music App I can copy this list of songs here and paste into an app.
Note this doesn't work the same way on the iPhone or iPad. You can enable it for that but there is no way to take an interactive screenshot. It will just revert to taking a capture of the whole screen and then giving you all the text it can find. Which may actually be fine depending on your needs. Hope you found this useful. Thanks for watching.
You can download the Shortcut here.