leeleblanc Posted April 24, 2021 Share Posted April 24, 2021 Alfred Experts! Can a global autocorrect alfredworkflow be created to work across the entire Mac OS in any application? I need your help. I have to use Windows at work. (I know. 🤮blargh🤮). But! I was able to convince my IT to get me a Mac. 💪 😁 One of the most pleasurable aspects in Windows though is the app, Autohotkey. This software corrects so many Windows faults. A heavy lift by Autohotkey is automatic spelling correction -globally. What you see below is comments in an .ahk file. An ahk file can be opened in any coding application or plain text editor. It is essentially a text file that can be read by Autohotkey if the file extension is .ahk I've seen a few incredible workflows for spelling. But, I can't find anything for automatic spelling correction. Does this workflow exist? Can you help me Obi Wans? Grateful for any input or thoughts! LL PS why don't I write a workflow? Well, I can't even program my coffee maker to brew automatically. Yes, I know pathetic. I won't even tell you how I still don't know how to program my microwave. Quote INTRODUCTION ; ; This is an AutoHotKey script that implements AutoCorrect against several ; "Lists of common misspellings": ; ; This does not replace a proper spellchecker such as in Firefox, Word, etc. ; It is usually better to have uncertain typos highlighted by a spellchecker ; than to "correct" them incorrectly so that they are no longer even caught by ; a spellchecker: it is not the job of an autocorrector to correct *all* ; misspellings, but only those which are very obviously incorrect. ; ; From a suggestion by Tara Gibb, you can add your own corrections to any ; highlighted word by hitting Win+H. These will be added to a separate file, ; so that you can safely update this file without overwriting your changes. ; ; Some entries have more than one possible resolution (achive->achieve/archive) ; or are clearly a matter of deliberate personal writing style (wanna, colour) ; ; These have been placed at the end of this file and commented out, so you can ; easily edit and add them back in as you like, tailored to your preferences. ; ; SOURCES ; ; http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings ; http://en.wikipedia.org/wiki/Wikipedia:Typo ; Microsoft Office autocorrect list ; Script by jaco0646 http://www.autohotkey.com/forum/topic8057.html ; OpenOffice autocorrect list ; TextTrust press release ; User suggestions. ; ; CONTENTS ; ; Settings ; AUto-COrrect TWo COnsecutive CApitals (commented out by default) ; Win+H code ; Fix for -ign instead of -ing ; Word endings ; Word beginnings ; Accented English words ; Common Misspellings - the main list ; Ambiguous entries - commented out and the massive list of corrections begins... Link to comment
deanishe Posted April 24, 2021 Share Posted April 24, 2021 Hi @leeleblanc, welcome to the forum. 1 hour ago, leeleblanc said: Can a global autocorrect alfredworkflow be created to work across the entire Mac OS in any application? That depends entirely on what you want it to autocorrect… You could implement autocorrect for common misspellings or accented English words as snippets, but only whole words. You can't do your double capitals or -ing. Link to comment
leeleblanc Posted April 24, 2021 Author Share Posted April 24, 2021 7 minutes ago, deanishe said: Hi @leeleblanc, welcome to the forum. That depends entirely on what you want it to autocorrect… You could implement autocorrect for common misspellings or accented English words as snippets, but only whole words. You can't do your double capitals or -ing. @deanishe! To get a response from you, so cool. I've been all over web. Thanks! You turn up in everyone's must have Alfred workflows, best of lists, single blog posts we're people explain how to use Alfred. You are quite literally everywhere when it comes to Alfred. So, yes, you're right. I don't really care for the workflow to correct double CAps. I really only care about correcting: http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings http://en.wikipedia.org/wiki/Wikipedia:Typo Microsoft Office autocorrect list So, how do I get going with some with some workflow help? Link to comment
deanishe Posted April 24, 2021 Share Posted April 24, 2021 (edited) 1 hour ago, leeleblanc said: To get a response from you, so cool. I've been all over web. Thanks! Flattery will get you everywhere. Here's your snippet collection for the Wikipedia misspellings (a workflow isn't really appropriate). Do you have a link to the contents of the Microsoft autocorrect list? Edited April 24, 2021 by deanishe TomBenz 1 Link to comment
leeleblanc Posted April 25, 2021 Author Share Posted April 25, 2021 18 hours ago, deanishe said: Flattery will get you everywhere. Here's your snippet collection for the Wikipedia misspellings (a workflow isn't really appropriate). Do you have a link to the contents of the Microsoft autocorrect list? 🗿🌟! Rockstar! deanishe! I had that idea in my head. But, then I became fixed on the idea that I needed a workflow -and stopped thinking about snippets. Funny how the mind works. So I hit your link and get a 404. I tried browsing your site too. Even looked under snippet. (Also checked your github repository) https://www.deanishe.net/snippet/ Can you re-upload? (On Microsoft list, I'll have to pull that off my work PC). Link to comment
leeleblanc Posted April 25, 2021 Author Share Posted April 25, 2021 Also, nice 'spin' on a phrase. 👍 Quote https://www.deanishe.net/post/2020/05/workflow-video-conferences/ The workflow has a few knobs to turn in its configuration sheet. Link to comment
deanishe Posted April 25, 2021 Share Posted April 25, 2021 9 minutes ago, leeleblanc said: So I hit your link and get a 404. I tried browsing your site too. Even looked under snippet. (Also checked your github repository) Sorry. The page is back now. I updated the site from here, but forgot to push the changes to GitHub, so the site got reverted overnight when the automatic build job ran. Link to comment
leeleblanc Posted April 25, 2021 Author Share Posted April 25, 2021 good stuff! Enjoy the beer! What's your preferred suds? Link to comment
deanishe Posted April 25, 2021 Share Posted April 25, 2021 1 minute ago, leeleblanc said: Enjoy the beer! Thanks very much! I will. 🍻 1 minute ago, leeleblanc said: What's your preferred suds? Just because I'm English doesn't mean I drink bathwater… I think Stern is on special offer this week. Link to comment
leeleblanc Posted April 25, 2021 Author Share Posted April 25, 2021 oh man! I mean suds like from Shawshank Redemption. Haven't come across Stern yet myself. Putting it on the list. Link to comment
deanishe Posted April 25, 2021 Share Posted April 25, 2021 10 minutes ago, leeleblanc said: I mean suds like from Shawshank Redemption 👍 I know what you meant. 10 minutes ago, leeleblanc said: Haven't come across Stern yet myself. I doubt you ever will, tbh. There are apparently only a couple of shops that sell it in Essen, and this is where it's brewed! Link to comment
leeleblanc Posted April 25, 2021 Author Share Posted April 25, 2021 cool. Sometimes text is flat. Noted. https://de.wikipedia.org/wiki/Stern-Brauerei_Essen ... maybe one day ... Link to comment
leeleblanc Posted April 25, 2021 Author Share Posted April 25, 2021 Also, can I ask how easy it was for you do this? And, how you did it? Link to comment
deanishe Posted April 25, 2021 Share Posted April 25, 2021 8 minutes ago, leeleblanc said: Also, can I ask how easy it was for you do this? And, how you did it? It was very easy for me because I already knew all of the necessary stuff (basic text parsing, structure of an Alfred snippet/snippet collection, creating a ZIP file in Python). I copied this list into my code editor (I use Sublime Text, but whatever), made sure each misspelling only had one correction (i.e. deleted all but one alternative), and pasted the text into a Jupyter Python notebook. Then I wrote the code to (a) parse the text into (misspelling, correction) pairs, (b) convert each pair into the appropriate structure for an Alfred snippet, (c) convert those structures to JSON, and (d) put them all in a ZIP file. (Alfred workflows and snippet collections – and a whole host of other file formats – are just ZIP files with different extensions.) It's only about 40 lines of code, all in all. Vero, leeleblanc and andy4222 1 2 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now