Live data from Hacker News

Hammerspoon – Lua-based powerful tool automation of macOS

hammerspoon.org

1–10 of 84 posts

Re: Hammerspoon – Lua-based powerful tool automation of macOS

#2
Really nice at first sight.

I'm getting melancholic vibes of AutoHotKey reading the docs, which was arguably my first entry into professional programming. Knowing nothing about coding, I built a service desk automation back then — with (network file-) shared hotkeys and a real GUI, all in one single file... good times.

Anyway, ever since switching to MacOS more than a decade ago, I've always been searching for an AHK analog for those simple keystroke automations, text-based, with just enough of a glue language to hold it all together — Automator never quite cut it for me, after wielding the full power of AHK, it always felt too limited, rigid and clicky-colory.

Even though I don't have immediate use cases for it anymore, it makes me very happy that I know where to go back now!

Re: Hammerspoon – Lua-based powerful tool automation of macOS

#4
post #2

Really nice at first sight. I'm getting melancholic vibes of AutoHotKey reading the docs, which was arguably my first entry into professional programming. Knowing nothing about coding, I built a service desk automation back then — with (network file-) shared hotkeys and a real GUI, all in one single file... good times. Anyway, ever since switching to MacOS more than a decade ago, I've always been searching for an AHK…

Have you tried AppleScript scripting? You can glue applications together and even use JavaScript if you’re not a fan of AppleScript

Re: Hammerspoon – Lua-based powerful tool automation of macOS

#7
I’ve especially enjoyed using Hammerspoon in combination with the prebaked config “Spacehammer” (https://github.com/agzam/spacehammer), which takes a lot of inspiration from Spacemacs (and, of course, enables a systemwide “edit this text field with emacs” workflow).

Re: Hammerspoon – Lua-based powerful tool automation of macOS

#8
post #2

Really nice at first sight. I'm getting melancholic vibes of AutoHotKey reading the docs, which was arguably my first entry into professional programming. Knowing nothing about coding, I built a service desk automation back then — with (network file-) shared hotkeys and a real GUI, all in one single file... good times. Anyway, ever since switching to MacOS more than a decade ago, I've always been searching for an AHK…

Have you tried AppleScript scripting? You can glue applications together and even use JavaScript if you’re not a fan of AppleScript

Did some, but the syntax wasn't my cup of tea. The _really_ great feature of AHK to me was having the triggers and the actions all in one place though, which is something I couldn't really replicate with AppleScript that only has the actions, with the triggers in Automator.

So with that runtime you could easily just write whatever would happen if you press which key combo (or do cronjob-like things managed by the runtime) and then write what happens inline.

Write it all to a single script, copy it to a coworker's computer, run it, several dozen key combos just work now.

That's something I couldn't manage to pull off in AppleScript or Automator, but then again maybe I was just too dumb.

Re: Hammerspoon – Lua-based powerful tool automation of macOS

#10
I fell briefly in love with Hammerspoon, but stopped using it.

My MacOS automation is now my QMK keyboard calling Alfred workflows; I use Yabai for window management.

I admire Lua, but ran into some sharp edges learning to program in it. Still, one can get up to speed quickly if one knows other scripting languages.

Hammerspoon window management was deathly slow. Yabai is close to instantaneous.

Post reply on HN