Phil,
A full functional trial version is free for 30 days.
It would appear that KM and Hammerspoon (HS) are apples and oranges.
HS looks like a relatively low-level language with a pure text development environment.
KM is a high-level automation tool where you visually add Actions, which range from simple to comprehensive. But you can can also make use of many different kinds of scripts, if you need to.
KM provides built-in features/Actions for much of what you would have to write scripts for in HS.
While there is a learning curve with KM, as there is with any automation tool, it is no where near that of learning a programming language. In addition, there are many pre-built KM Macros available (each can be customized), and the KM forum offers the
best help of any I've seen.
I think it comes down to how much you value your time. With KM, you can complete powerful, useful macros the same day you install it.
Finally, KM is under active development, and has been for many years. The developer is brilliant, very dedicated, and interacts daily with his users in the KM forum. He is very responsive to bug reports and enhancement requests.
Best Regards,
Jim Underwood
aka
JMichaelTX
Well,
if you’re going to go 3rd party you can also achieve what you want very easily with Hammerspoon, which has the added advantage of being free.