I write a lot of scripts that grab screenshots with screencapture, fire CleanShot X’s URL handler, or shove rectangles into AppleScript window frames. The annoying part has never been the capture itself — it’s getting the exact coordinates for the region I care about. I’ve eyeballed them, measured with Digital Color Meter, typed numbers into a calculator, and still gotten them wrong more often than I’d like.
You run screencoord, and every display gets a dimmed overlay with a crosshair. Drag out a rectangle, then fine-tune it — corner and edge handles to resize, drag inside to move. There’s a live size readout next to the selection, plus Confirm / Cancel buttons.
Hit Return (or Confirm) when you’re happy. Esc or Cancel bails out.
On success it prints one line of coordinates to stdout and copies that same string to the clipboard. Cancel leaves the clipboard alone, which matters when you’re mid-script and don’t want to nuke whatever you already copied.
No Screen Recording permission, no Accessibility dance. It only draws an overlay and returns numbers — it doesn’t take the screenshot for you.
Formats
By default you get the screencapture -R shape:
screencapture -R"$(screencoord)" shot.png
That prints something like 100,200,800,600 — x,y,width,height in screen points, top-left origin at the primary display.
If you’re wiring things into AppleScript (or anything that wants a list literal), switch formats:
screencoord --format applescript
That gives you {100, 200, 800, 600} instead. Same rectangle, different string shape.
Exit codes are boring on purpose: 0 success, 1 cancelled, 2 bad args / overlay failure. Easy to gate a script on.
Multiple displays
Fair warning: multi-display is wired up but not fully tested yet. The overlay lands on every screen and clamps the selection to whichever display you started on. That path needs more real-world poking before I’d call it battle-tested.
How screencapture -R usually thinks about multiple monitors, for context: there’s one global point grid for the whole desktop. (0,0) is the top-left of the primary display. A monitor to the right of primary gets an x past the primary width; one to the left gets a negativex. Same idea for monitors stacked above/below with y. You don’t pass a display number to -R — just a rectangle in that shared space (use -D <id> when you want a whole display by ID instead).
ScreenCoord aims to spit out coordinates in that same space. If an external display gives you nonsense numbers, file an issue with your layout and a sample string.
Install it
Grab a binary from the latest GitHub release, or install with Homebrew (no Xcode required — it’s a prebuilt universal binary):
brew tap ttscoff/thelab
brew install screencoord
Source is on GitHub if you want to poke at it. It’s a small Swift + AppKit CLI, and the selection bits are separated from the formatting so I can wrap it in a menu-bar app later if that itch comes back.