rvachev.orgEN / RU / 🤖
← Back to essays
· Essay · 1 min

Automating Screenshots with HammerSpoon

Automating the process of screenshots and interaction with ChatGPT using HammerSpoon.

Something about this week feels like vibe coding; I’m trying to automate everything and anything (at least frequently used actions).

Today, I decided to automate the process of taking a screenshot, sending it to ChatGPT, and asking a question. On one hand, this takes 10-15 seconds, but on the other hand, how nice it is to do it in 1-2 seconds. In the end, I vibe coded a script for HammerSpoon (an incredibly cool automation tool that I wrote about here and use every day, at least for rewriting text and checking grammar through GPT “on the fly”). It works on the principle of regular screenshots; by using the cmd+shift+1 combination, you select an area, and it automatically ends up in ChatGPT.

So, I’m attaching the LUA file in case you also want to speed up your life a bit.

P.S. I can almost feel the joke about how a programmer is a lazy person who is willing to spend 8 hours to avoid repeating an action that takes 10 seconds.

Newsletter

Get new posts by email

A weekly digest of what I write about AI, software and products. Unsubscribe anytime.