79 questions
0 votes
0 answers
53 views
Execution just stops after taking a screenshot
This is a minimal version of my init.lua hammerspoon config https://gist.github.com/Touniouk/9b7f61f5d283a1514a386b1068ec8810 My goal is to Take a screenshot of an app Read some text on it Click a ...
1 vote
1 answer
73 views
How to crop screen captures using hammerspoon
I wrote the safest possible example of screen capture using hammerspoon, here it is function SafeSnapshotWindow(appName, savePath) local app = hs.application.find(appName) if not app then ...
0 votes
0 answers
68 views
Why is my AppleScript not working as intended in Hammerspoon?
This is my literal first time coding anything in AppleScript / Hammerspoon. So I want to make an AutoClicker to stress test my website. The website is simple enough; it has a button for me click, ...
2 votes
2 answers
151 views
How to "require" a LUA script within a Spoon-package?
We have base LUA file ~/.hammerspoon/init.lua which can load a spoon package: hs.loadSpoon("Foo") Now we have our package file init.lua by path: ~/.hammerspoon/Spoons/Foo.Spoon/init.lua It ...
2 votes
1 answer
284 views
Strange issue with hammerspoon window movement
I am new to HS and I just try to implement a simple function to make my active window left half, here is my code, I'm confused as to why I have to press cmd+left three times to make this work? hs....
1 vote
1 answer
204 views
How to switch windows on only a single space on the active desktop?
While switching windows with keyboard on MacOS, the default CMD+TAB command shows all the active windows. I use hammerspoon to switch only between windows on a single desktop. This is the script I use ...
0 votes
1 answer
213 views
How to configure hs.hotkey.modal with Fennel in hammerspoon?
I'm trying to convert some Hammserspoon Lua code to Fennel, but the converted code is throwing the following error. ERROR: LuaSkin: hs.hotkey callback: init.fnl:32: attempt to call a table value ...
0 votes
1 answer
98 views
Spotify DJ button: any way to click it from the CLI (or AppleScript, or Hammerspoon, or...)
Is there any way to simulate clicking the Spotify DJ button in the macOS Spotify application from outside Spotify, for example with a keypress? Of course, I could just bring up the Spotify window and ...
2 votes
2 answers
823 views
Hammerspoon bind "cmd" & "shift" without any other key
I want to use hammerspoon to replicate Windows' language switching using Alt and Shift. For this I want to add a hotkey bind for command and shift, but all my attempts fail. I tried: hs.hotkey.bind({&...
0 votes
0 answers
44 views
Lua number comparison returns wrong result [duplicate]
I tried to use the hamerspoon package to write a timer as follows. local function startTimer() local totalSeconds = 5 local i = 0 local function onTimeout() i = i + .1 local ...
1 vote
0 answers
429 views
Hammerspoon Keystroke not working on new MAC
I used to have hammerspoon configured on my previous MAC but when I switched to the new MAC (M1) the keystroke is not working while other functions are. Any idea if the new MAC could be blocking ...
1 vote
3 answers
606 views
How to find specific chrome tab across all spaces using hammerspoon
I want to use hammerspoon to find one specific chrome tab across al chrome windows across all spaces. The only way I was able to achieve this was using osascript, which I don't like much because it ...
1 vote
0 answers
84 views
Can I edit Finder context menu items with Hammerspoon?
With Automator I can create Quick Actions in Finder. Is it possible to do the same thing with Hammerspoon?
0 votes
1 answer
651 views
Using unknown/undefined keyboard (keymap) in hammerspoon
I have attached to my mac a keyboard with additional (nonstandard) keys. See the image at the end of post. Here is my testing Hammerspoon init.lua local hyper = {"cmd", "alt", &...
0 votes
0 answers
182 views
LUA - Hammerspoon - Loop - eventtap keeps triggering
I'm trying to write a fairly simple script for Hammerspoon where I am looping through a table of app windows. The problem is for some reason when I call hs.eventtap inside the loop it keeps firing. ...