3 ms·
Bookmarklets/userscripts are such an excellent showcase of why the web is so empowering to users and why native apps are such a depressing, user-hostile regress
by kibwen 3y ago
Bookmarklets/userscripts are such an excellent showcase of why the web is so empowering to users and why native apps are such a depressing, user-hostile regression.
Example from literally just this morning: I'm organizing an event and the venue wanted an attendee list in Excel format. The event is organized through meetup.com, which has been "app-ifying" their site for years now, which is to say, turning it to useless crap. I went to the list of attendees for the event and tried to copy-paste the 80-ish names so I could clean it up into a usable list... but some cabbage-brained PM has apparently decided that users shouldn't be allowed to copy-paste names out of the attendees list (literally all the text on the page except attendee names was selectable). Fortunately it was trivial to whip up a tiny script to circumvent this, and made me appreciate how annoying it would be to transcribe this all by hand if all I had was a useless locked-down mobile app.
- mdrzn 3y agoCases like this highlight the importance of having accessible OCR tools, such as the one in Windows PowerToys which I learned to love. With just a shortcut you can extract text from any window, effectively bypassing browser or app limitations.
- crimsontech 3y agoThis is also built in to macOS and iOS now too. Such a handy feature that I find myself using a lot.
- dimator 3y agoHow does one do this in macos?
- solardev 3y agoI thiiiiiiiiink it's technically part of Preview (you can paste it into that app after you take a screenshot): https://support.apple.com/guide/preview/interact-with-text-in-a-photo-prvw625a5b2c/mac https://support.apple.com/guide/preview/interact-with-text-i... I don't THINK there is a way to do it straight from the snipping tool, but someone correct me if I'm wrong. Edit: Personally I use the paid Cleanshot app, which is not only great for OCR but all sorts of screenshots, videos, and annotations: https://cleanshot.com/ https://cleanshot.com/ You just drag a box around the text, click "OCR", and it gets copied into your clipboard. I find it easier & faster than having to deal with Preview. I think the free Shottr does the same: https://shottr.cc/ https://shottr.cc/
- reaperducer 3y agoI don't THINK there is a way to do it straight from the snipping tool, but someone correct me if I'm wrong. It can be done from the screenshot tool. Take the screenshot, and an icon will appear in the lower-right corner of the preview. Click that icon and it selects all of the text in the preview. If you don't want all to select all of the text in the window, just select the text in the image the same way you'd select text in any other program. I find it easier & faster than having to deal with Preview. OCR is system-wide on macOS without Preview.
- solardev 3y agoGreat, thanks for the explanation!
- mediumsmart 3y agoHave a look at textgrabber in this article: https://news.ycombinator.com/item?id=38711357 https://news.ycombinator.com/item?id=38711357
- solardev 3y agoI think the parent is saying you don't need any third-party apps anymore, it's just built in to macos now.
- mediumsmart 3y agoIt does say that yes, and that is correct. at least it is on my macos. Did you try textgrabber? The article refers to 2024.
- 0cf8612b2e1e 3y agoOn Linux, I created a little script which uses maim to capture a user selected screen region, save that to a file, run tesseract, and dump the output to stdout. Since it is all digital (minus weirdo fonts) the OCR should be perfect.
- reaperducer 3y agoHow does one do this in macos? On recent Macs, it's automatic in most programs, including Mail, Preview, Quickview, and others. Just hover your pointer over text in an image, and if the computer recognizes it, you get a text cursor so you can select the text. No extra software needed. If it's a language you can't read, you can often ⌥click the selected text and it will be translated into the language of your choice.
- lancesells 3y agoIt's in the last two versions of macOS. You can grab text off of pretty much anything (with text). I've occasionally found it annoying when I'm trying to drag and drop an image that contains text but it's very useful and seamless.
- BlueTemplar 3y agoIsn't the distinction instead between open source and closed source ? (With minified JavaScript counting as "closed" for most intents and purposes.)
- kibwen 3y agoI didn't need the source to fix the issue here, I can trivially introspect and open a console to modify the page with a single keypress.
- roywiggins 3y agoYou can usually extract text straight from the DOM (barring special efforts to obfuscate it), it doesn't matter much if there's layers of opaque JavaScript generating it.
- AnthonyMouse 3y agoIt's not about controlling the source code (though that certainly helps), it's about controlling the device. If this was a native app on Linux or even Windows, you could attach a debugger and do the same kind of things whether or not you had the source code. An iOS app, not so much.
- kixiQu 3y ago> If this was a native app on Linux or even Windows, you could attach a debugger and do the same kind of things whether or not you had the source code. Notably, though: for a certain value of "you" more narrowly scoped than the "you" capable of writing a few lines of JavaScript.
- AnthonyMouse 3y agoNah. Most people can't even write the JavaScript and the ones who can learn that are also generally capable of learning the desktop equivalents. If there was any difference in difficulty it would be purely arbitrary as a result of which one currently has easier to use tools to do what you're trying to do. A lot of these kinds of things can be done in a few lines of bash or PowerShell. If there is any fundamental difference, it's that in traditional desktop applications everything is local and the inability to run without an internet connection is something you might complain about. Whereas for a browser you might be surprised if that was even possible, and then there will be things you can't do because you'd need data which is only on the server and is never supplied to the client, or run into rate limiters or be unable to do it privately because your activity generates logs on the server etc.
- tjoff 3y agoHow is that an example of native apps? That is just an example of modern web, that is the depressing part. Actually been giving an excel file would have been liberating.
- kibwen 3y ago"Produce any arbitrary file from any arbitrary page, Pandoc-style" would be a nifty feature, but not one that I expect sites to provide. Instead, just give me access to the data, that's all I need and expect, and what used to be standard before mobile apps caused our standards to fall.