Hey, I quickly translated the AHK Script from Hadronox / Rezel to a MacOS HammerSpoon Script.
local toggle1 = false
local toggle2 = false
hs.hotkey.bind({}, "1", function()
toggle1 = not toggle1
if toggle1 then
hs.timer.doWhile(function() return toggle1 end, function()
hs.eventtap.keyStroke({"cmd"}, "1")
hs.timer.usleep(150 * 1000)
end)
end
end)
hs.hotkey.bind({}, "2", function()
toggle2 = not toggle2
if toggle2 then
hs.timer.doWhile(function() return toggle2 end, function()
hs.eventtap.keyStroke({"cmd"}, "2")
hs.timer.usleep(150 * 1000)
end)
end
end)