Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hammerspoon - how to paste text?

I can't find it in the docs - how do i paste text with Hammerspoon on OS X?

I tried the following:

hs.hotkey.bind({"ctrl", "pad1"}, "1", function()
    hs.eventtap.keyStrokes("this needs to be pasted!")
end)

but it does not work.

I pressed "control" and Numpad's "1" on my keyboard.

Thanks for help!

like image 338
louis Avatar asked Jan 31 '26 03:01

louis


1 Answers

I found out how it works, the keybinding was wrong.

hs.hotkey.bind(
    {"ctrl"}, "Pad1", function()
        hs.eventtap.keyStrokes("asd") end
    )

Thank you all for helping.

like image 197
louis Avatar answered Feb 03 '26 11:02

louis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!