Link Search Menu Expand Document
-- Call Hammerspoon functions from AppleScript

-- First activate applescript support:

-- Then you can call functions from your lua code like this:
tell application "Hammerspoon"
execute lua code "showClipBoardContent()"
end tell

-- In the above case it would call showClipBoardContent() function
-- Bind function to hotkey
hs.hotkey.bind("ctrl", "return", function(){title="Hammerspoon", informativeText="Hello World"}):send()
-- URL handler alert

hs.urlevent.bind("someAlert", function(eventName, params)"Hey there alert")

-- After having this line in init.lua
-- you can then call it from the shell like so
open -g hammerspoon://someAlert