Use Aspell (Homebrew Package) to Spell Check a Word

Thanks Jim! That's high praise coming from you :grin:

Thank you too for the heads up about the path in your copy of the macro. Does setting an ENV_PATH variable not work for you for some reason?

Also, thanks for the PM about the clipboard; I made an adjustment to version 1.1.2 to restore the original system clipboard.

-Chris

Oh, I'm sure it would; however, I try to build macros that I can share and not have worry about the users' configuration.

Thanks again for sharing!

1 Like

Good point. It makes me think I should edit my recent macro posts to make sure end-users are aware of the need to setup an ENV_PATH variable. I assume if they're familiar with Homebrew and installing packages they would already know this... but at the same time I think that was something that tripped me up initially.

Back to the drawing board haha! :laughing:

UPDATE: Version 1.2.0 is up.

If you use this in conjunction with Typinator, the spell check prompt list will be positioned next to the Create new Typinator Item window if it is open.

I don't know what I am doing wrong or is ENV_PATH doesn't work because files in m1 macs are a little different.

I downloaded Aspell from homebrew and its working great in terminal.
I downloaded ENV_PATH macro and run it.

When I run your macro nothing happen no list appear nothing. I also tried @_jims way but didn't work.

I don't have Typinator and I disable this group.

CleanShot 2022-05-18 at 13.32.35

I hope you can help me.

Hi there! I'd be glad to help you troubleshoot the issue. If possible, post your macro here (or at least a screenshot of the entire macro including triggers). I just want to confirm that nothing critical has been changed, perhaps even unknowingly.

Also, could you clarify what you mean by this part?

There's no ENV_PATH macro; there's only this macro. The ENV_PATH is a variable you have to add yourself to ensure this runs properly. It's easy to do, and this page gives more information on how to do it.

If you could get back to me with that info we'll go from there!

-Chris

That's what I meant, sorry. I ran his macro and this what I got.

Photo

Gif

CleanShot 2022-05-18 at 17.43.37

I only disable the Typinator group in the macro nothing else.

That just means you already have a variable called "ENV_PATH".

Go to KM's Preferences, click the Variables tab, find "ENV_PATH" and let us know what it is set to.

Without seeing your macro itself... it looks like maybe you changed the trigger? I see you pressing ⇧⌘C, or something to that affect, but the macro is designed by default to use ⌃⇧S for English and ⌥⇧S for Spanish.

If you changed the triggers can you verify you changed the corresponding lines...

...in this action? (click to expand/collapse)

I just realized I don't mention that in the release notes... i'll update that and repost here shortly.

It's the same ⌃⇧S I also wrote "-spell" to make sure.

photo

02)Homebrew: spell check using aspell.kmmacros (74.7 KB)

Ok great, thanks for verifying that.

So your copy works just fine on my end, which leads me to believe it's an issue with the Homebrew package; perhaps where it's installed.

Do this: open Terminal, type brew info aspell and note the location where it is installed. On mine it is /usr/local/Cellar/aspell/0.60.8. Verify that your ENV_PATH includes the /usr/local/Cellar part or at least /usr/local/ in it. Report back and we'll go from there.

1 Like

Hi @A_A. If I'm tracking your problem correctly, I think this might help...

Open the Terminal application; at the shell prompt type:

where aspell

On my system, the where command returns:

/usr/local/bin/aspell

That will display the path you need. You can use it with the method I suggested or use it with the aforementioned ENV_PATH variable.

1 Like

Hey Jim! Thanks for chiming in, your CLI skills are way beyond mine (as are most if not all of your other skills too haha).

1 Like

Haha, age has some advantages. On a good day we call it experience.

BTW, here's some trivia on the matter: What is the difference between which and where - Unix & Linux Stack Exchange

My system also includes the whereis utility.

1 Like

Thank you so much @_jims and @cdthomer it is working now.

Homebrew in in M1 Macs is in /opt/

and Aspell is downloaded in

/opt/homebrew/bin/aspell

So for any one with M1 Macs you have two options

@cdthomer way by copying /opt/homebrew/bin/ in the provided macro that set ENV_PATH

Before

After

or

@_jims way
by adding the same path inside the original macro as he mentioned before

Photo

I tried both ways all them works perfectly.

2 Likes

Hey I'm stoked that you were able to get it working. I should have thought of this a little earlier because my wife's MacBook is an M1 and I had to setup the environmental path variable differently on hers... but that was so long ago I forgot haha.

Anyhoo, be sure to let me know how you like the macro itself and if you have any ideas to improve it. :grin:

-Chris

Haha well I know I don't have as much "experience" as you but i'm at least old enough these days to understand what you're talking about. :sweat_smile:

1 Like

I wouldn't go through all of this trouble if it's not amazing. thank you :heart:

2 Likes

Thank you for those kind words!

If you're a Typinator user, check out the macro I built to quickly add a mistyped word to a set using Typinator's AppleScript dictionary and Aspell to provide spelling suggestions.

KMF: Redesigned: Quickly Create an Auto-Correction Expansion With Typinator (Using Aspell and Typinator's AppleScript dictionary)

2 Likes

Thank you for this amazing macro. I made some edits so it can support Medical Terms.

I used (hunspell) instead of (aspell)

Files

Dictionary.zip (577.5 KB)

Then I copied these files to /Users/"your user name"/Library/Spelling

Then I edited the macro command

Before

After

example

Video

CleanShot 2022-07-04 at 14.34.31

Finally, I would appreciate the help if someone can implement this on aspell instead of hunspell or edit the macro so it use aspell when it is a normal world and use hunspell when it is a medical term.

hunspell with Medical Terms.kmmacros (70.7 KB)

Link from where I got the Medical Dictionary

https://github.com/glutanimate/hunspell-en-med-glut