Can we use HammerSpoon to expand text just like aText or TextExpander ?
There is hs.eventtap.keyStrokes("asdf") but how to detect the keystroke and expand the text?
E.g. One use case is to expand mme -> [email protected].
How to achieve this with HammerSpoon ?
The very nice, open source Spoon (a HammerSpoon plugin/library) called HammerText is the solution here. However, it's not perfect because the solution randomly stops working after some time and nobody knows why - probably a HammerSpoon bug.
https://gist.github.com/maxandersen/d09ebef333b0c7b7f947420e2a7bbbf5#file-init-lua
For good measure, the example you've given does not require HammerText, aText or TextExpander, just plain Mac System Preferences > Keyboard > Text replacement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With