rhettbull / textinator Goto Github PK
View Code? Open in Web Editor NEWSimple MacOS StatusBar / Menu Bar app to automatically detect text in screenshots
License: MIT License
Simple MacOS StatusBar / Menu Bar app to automatically detect text in screenshots
License: MIT License
Textinator doesn't OCR the text when Dropbox's "Share screenshots and screen recordings using Dropbox" setting is toggled on. Instead of getting a copy of the text found in the screenshot, I receive a copy of the Dropbox share url to the screenshot
Would it be possible to add the ability to override this feature?
Just curious because it takes many clicks to toggle Dropbox's feature on/off.
Thank you!
Some of Textinator's menu entries don't follow the official Apple Guideline: "Use title-style capitalization if you need to use more than one word in the menu title.":
Sometimes you don't want your clipboard affected when taking a screenshot containing text. It would be nice to be able to pause Textinator. Even better: Pause it for a period of time (or, if possible, for the next screenshot).
And/or add a configuration option whether to display a confirm dialog whenever Textinator is about to affect your clipboard.
Reference this for detecting dark mode.
Following the instructions from Developer Notes with a few additions:
git clone https://github.com/RhetTbull/textinator.git
cd textinator
python -m venv ~/venv/textinator
source ~/venv/textinator/bin/activate
python3 -m pip install --no-cache-dir -r requirements.txt
python3 -m pip install --no-cache-dir -r dev_requirements.txt
The second pip install
issues errors:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyobjc-framework-coreml 10.0 requires pyobjc-core>=10.0, but you have pyobjc-core 8.5.1 which is incompatible.
pyobjc-framework-coreml 10.0 requires pyobjc-framework-Cocoa>=10.0, but you have pyobjc-framework-cocoa 8.5.1 which is incompatible.
pyobjc-framework-vision 10.0 requires pyobjc-core>=10.0, but you have pyobjc-core 8.5.1 which is incompatible.
pyobjc-framework-vision 10.0 requires pyobjc-framework-Cocoa>=10.0, but you have pyobjc-framework-cocoa 8.5.1 which is incompatible.
pyobjc-framework-vision 10.0 requires pyobjc-framework-Quartz>=10.0, but you have pyobjc-framework-quartz 8.5.1 which is incompatible.
I don't even understand where the pyobjc-core 8.5.1
comes from, since the requirements.txt
asks for pyobjc-core>=9.2
. I was deliberately using option --no-cache-dir
for the pip install
to make sure that no cached version of the packages would be installed.
Trying to solve it:
pip-compile requirements.txt dev_requirements.txt -o -
gives me:
ERROR: Cannot install -r dev_requirements.txt (line 2), -r requirements.txt (line 1) and pyobjc-core>=9.2 because these package versions have conflicting dependencies.
running build.sh
in spite of this still generates a DMG file, but the contained application aborts with "Launch error".
Towards the end of the build-run there's:
...
Modules not found (unconditional imports):
* _abcoll (rumps.packages.ordereddict)
* _io._WindowsConsoleIO (importlib._bootstrap_external)
* _overlapped (asyncio.windows_events)
* com (com.sun.jna)
* com.jna (com.sun)
* com.sun (com.sun.jna.platform)
* dummy_thread (rumps.packages.ordereddict)
* jinja2 (pkg_resources._vendor.pyparsing.diagram)
* pyparsing (pkg_resources._vendor.pyparsing.diagram)
* railroad (pkg_resources._vendor.pyparsing.diagram)
* thread (rumps.packages.ordereddict)
* win32com (win32com)
* win32com.shell (win32com.shell)
* win32com.shellcon (win32com.shell)
Modules not found (conditional imports):
* _manylinux (pkg_resources._vendor.packaging._manylinux)
* com (pkg_resources._vendor.appdirs)
* com.sun.jna (pkg_resources._vendor.appdirs)
* com.sun.jna.platform (pkg_resources._vendor.appdirs)
* pep517 (importlib.metadata)
* win32com (pkg_resources._vendor.appdirs)
* win32com.shell (pkg_resources._vendor.appdirs)
...
Running the generated application from the command line with /Applications/Textinator.app/Contents/MacOS/Textinator
gives me:
ModuleNotFoundError: No module named 'rumps'
How do I set up my development environment for this to compile? I'd love to contribute to the project.
Textinator only picks up Screenshots at the default location (Desktop) but ignores other configured locations.
Pressing ⌘Shift5 and then Choosing "Options", offers to configure alternative locations to save screen shots to.
However, Textinator ignores these.
> How about this, would it be possible to keep a clipboard cache that stores the text of the previous OCR job? I
That's not a bad idea. You could do this with a clipboard management app but it should be easy to add a "Copy last text detection to clipboard" feature and maybe an option to pop up a window with the last detection.
Originally posted by @RhetTbull in #31 (comment)
When you use Ctrl-Cmd-Shift-4 to copy a section of the screen, it is not saved as a screenshot, but is merely kept in the Clipboard. Often I don't need to have a screenshot as a file when capturing it just for the sake of text recognition. It would be useful to have Textinator also react to this constellation and perform text recognition of a picture in the clipboard.
Think about implementing a “Confirmation” option that would pop up a dialog box showing the detecting text and asking for confirmation to change the clipboard.
Originally posted by @RhetTbull in #3 (comment)
I often wish for additional features to Textinator's existing functionality, like:
import time
gmt = time.gmtime(time.time())
What ends up in your clipboard instead:
“import time
gmt = time.gmtime(time.time())”
Excerpt From
Programming Python
Mark Lutz
This material may be protected by copyright.
So, Textinator would become like a hub for clipboard manipulations of which its existing OCR-functionality is but a plugin.
Here's an example script I currently have in my bin
-directory, which would become a plugin in this Textinator-hub:
#!/usr/bin/env python
from titlecase import titlecase
import pyperclip
pyperclip.copy(titlecase(pyperclip.paste()))
The icon is always white even when other menu bar icons are dark. Set self.template = True
to fix this. Reference: https://rumps.readthedocs.io/en/latest/App.html#rumps.App.template
Copying text from a cell within a Microsoft Excel Worksheet triggers Textinator, even though that is already text.
Current binary is x86_64 only. See --arch
Hello, I was wondering if it's possible to specify the language of the text to extract from the screenshot?
Great work and thank you!
Add a help menu that uses Help Viewer to show help page.
The testsuite currently seems to be failing:
================================================================= short test summary info ==================================================================
FAILED tests/test_textinator.py::test_screenshot_no_notification - AssertionError: assert 'notification:' not in '2023-11-17T... happened.\n'
FAILED tests/test_textinator.py::test_screenshot_qrcode - AssertionError: assert '' == 'https://gith...ll/textinator'
FAILED tests/test_textinator.py::test_screenshot_qrcode_with_text - AssertionError: assert 'https://github.com/RhetTbull/textinator' in 'SCAN ME'
FAILED tests/test_textinator.py::test_screenshot_qrcode_with_text_no_detect - AssertionError: assert 'https://git...l/textinator' not in 'SCAN ME\nht...l...
FAILED tests/test_textinator.py::test_pause - AssertionError: assert 'Paused\nHello World' == 'Paused'
FAILED tests/test_textinator.py::test_confidence - AssertionError: assert '' == 'Hello World'
FAILED tests/test_textinator.py::test_clipboard_basic - AssertionError: assert '' == 'Hello World'
FAILED tests/test_textinator.py::test_confirm_clipboard_changes_yes - assert False
FAILED tests/test_textinator.py::test_confirm_clipboard_changes_no - assert "'confirmation': 1" in "2023-11-17T16:11:19.032612 - search: an update happen...
FAILED tests/test_textinator.py::test_about - assert False
========================================================= 10 failed, 8 passed in 132.69s (0:02:12) =========================================================
Rumps 0.4.0 now supports python 3.10
Update Textinator to use 0.4.0 and update docs
An app extension would allow Textinator to be used on existing images using the right-click context menu. Alternatively, Textinator could register a Service for use from Services menu.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.