GithubHelp home page GithubHelp logo

alfred-screenshot-ocr-workflow's Introduction

Alfred Screenshot OCR Workflow

Work in progress, dependencies need to be installed

A handy workflow to convert parts of the screen to text, performing OCR on the captured image.

The workflow is triggered by a shortcut or keyword, prompts the user to capture an area of the screen using the built-in screencapture app from OS X, and then performs an OCR on the resulting image and sets the result to the clipboard.

The workflow uses the Tesseract OCR open source library to perform the actual OCR. Sadly, I still don't know how to bundle all the runtime dependencies together to ship with the workflow, so it currently only works if you have the tesseract application already installed in you system. You can install with homebrew: brew install tesseract --all-languages

Usage

Trigger the workflow with the registered shortcut (default is ⌘+⌃+⇧+o) or the keyword screentotext, and you'll see the default cross icon from OS X screencapture app. Capture the desired region and the OCRed text will be placed back to the clipboard.

capture

You can use the keyword trigger to override the default language config and make a capture with a different language. Say you have English config, but you're browsing a Spanish webpage and want to capture some text; you don't want to change the config to spanish, you'll just use it this time. You do this by selecting an alternative language on the options displayed, you can filter options by typing the desired language name.

config

Installation

For OS X 10.9 Mavericks, Download the alfred-screenshot-ocr.alfredworkflow and import to Alfred 2.

As said previously, I couldn't find a proper way of bundling the Tesseract binary and dependencies to pack them all in the workflow, so you need to have Tesseract installed, preferably with all the languages, unless only using english.

To install Tesseract, run brew install tesseract --all-languages, remove the --all-languages if you only need english.

Configuration

You can select the default language or languages from the workflow config. Run the config with the keyword configscreentotext and you'll see the first result showing the current languages, and a list of available languages to add or remove; they work as a toggle, so I you have one, actioning over it will remove it, and if you don't, it will add it. You can also filter the options by typing the desired language name.

Please keep in mind this is the default Tesseract languages list from the Homebrew install with all the languages, it's not reading the available languages form your system. Optionally you can simply remove the config option from the workflow if you're only using English.

Changelog

  • 2014-04-09 - Released

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.