Skip to content
Gnohz Gniy edited this page Apr 7, 2024 · 19 revisions

Capture Screen on Mac

TextGrabber2 does not take screenshots. Instead, you can use the system's built-in keyboard shortcuts to copy a portion of the screen to the clipboard and open TextGrabber2 to detect text.

By default, the keyboard shortcut for this action is Control-Shift-Command-4, as mentioned here (the last section).

However, pressing Control-Shift-Command-4 can be difficult, so it is recommended to remap it to a simpler combination. Please check out Apple's documentation for details.

I personally use Shift-Command-2, in case you're interested.

Connect to System Services

TextGrabber2 offers a way to use system services, you can easily integrate your workflows, this includes support for the Shortcuts app (similarly, it works with the Automator app too).

A service is defined as simplify just two properties (both are required, make sure all items are valid), for example:

{
  "serviceName": "Search With %WebSearchProvider@",
  "displayName": "Search in Safari"
}

displayName is just what we see in TextGrabber2. It can be arbitrary, choose something you like.

serviceName is the identifier to find the service, it is often different from its display name.

To find names for core services, open /System/Library/CoreServices/com.apple.NSServicesRestrictions.plist (need a plist editor, like Xcode) and search for NSServices and NSMenuItem.

Also, if an app offers services, open AppName.app/Contents/Info.plist and search for NSServices and NSMenuItem. For example, /System/Library/Services/Summary\ Service.app/Contents/Info.plist tells us its service name is Summarize.

Luckily, if the service is built using Shortcuts (or Automator), its serviceName will be exactly the Shortcut name. Here is an example of how we build a simple translate service using Shortcuts:

Translate

Make sure Services Menu is checked, and use Translate as the serviceName in our configuration file.

The output of the service will be copied back to the clipboard. It's recommended to only grab one sentence from the screen, if multiple sentences are recognized, the input will be joined with spaces.

Clone this wiki locally