hammerspoon

mail@pastecode.io avatar
unknown
lua
3 years ago
472 B
2
Indexable
Never
app = hs.application.applicationForPID(406)
hs.hotkey.bind(
    {"cmd", "alt", "ctrl"},
    "W",
    function()
        myTimer =
            hs.timer.doEvery(
            120,
            function()
                hs.eventtap.keyStrokes("a", app)
            end
        )
        hs.alert.show("Starting script!")
    end
)

hs.hotkey.bind(
    {"cmd", "alt", "ctrl"},
    "Q",
    function()
        myTimer:stop()
        hs.alert.show("Stopping script!!")
    end
)