I'd like to make a spell check helper. Basically a keyboard shortcut driven auto-correct spell checker.
1.) User selects text
2.) Issue a keyboard shortcut or some simple trigger
3.) Take the highlighted text and make an API call to some service (maybe this or something similar) and get the suggested correct spelling
4.) Parse the response of the API call
5.) Paste that new text overtop of the selected text
It's like a spell check that will work anywhere on the computer. Has anyone done anything like this? It seems like it could be possible. The trick part I think would be making the API call and parsing the response. I've built many work flows in Alfred before, but I haven't tried this one yet.
What's the best way to do this? I'm thinking to either trigger a script, apple script, or just a terminal command. I didn't see any built in API related features in Alfred.
This makes me wonder. Is there a timeout for an action? I haven't ever used Alfred to trigger a script. What happens if the API call takes 30 seconds. I could assume it failed and change screens only to have the text paste somewhere else undesirable.