Skip to content

Repository files navigation

screencoord

Select a screen region by dragging a rectangle, then print and copy coordinates ready for screencapture or AppleScript. The tool shows a dimmed overlay on all displays; drag to create a selection, resize with handles, move by dragging inside the rect, and confirm with Return or the Confirm button. Esc or Cancel aborts without changing the clipboard.

Install (Homebrew)

brew tap ttscoff/thelab
brew install screencoord

No Xcode required — the formula installs a prebuilt universal macOS binary from GitHub Releases.

Build from source

Requires Swift (Xcode or Command Line Tools):

swift build -c release
cp .build/release/screencoord /usr/local/bin/

Releasing

Tag a version to build and publish the Homebrew tarball via GitHub Actions:

git tag -a v0.1.0 -m "screencoord 0.1.0"
git push origin v0.1.0

Then update sha256 (and version) in ttscoff/homebrew-thelab Formula/screencoord.rb to match the release asset checksum.

Usage

Default format is screencapture (x,y,w,h in screen points):

screencapture -R "$(screencoord)" output.png

AppleScript format (screen points):

screencoord --format applescript

Show help:

screencoord --help

On success, the same coordinate string is written to stdout and copied to the clipboard. Cancel leaves the clipboard unchanged.

Formats

Format Coordinate space Output example Use with
screencapture (default) Screen points, top-left origin at primary display 100,200,800,600 screencapture -R
applescript Screen points, top-left origin at primary display {100, 200, 800, 600} AppleScript screen math

Both formats describe the same rectangle in screen points; only the string shape differs. screencapture -R takes points, so a selection on a Retina display is not scaled by the backing factor.

Exit codes

Code Meaning
0 Success — coordinates printed and copied
1 Cancelled — no output, clipboard unchanged
2 Invalid arguments or overlay failure

Permissions

screencoord only draws a coordinate-selection overlay; it does not capture screenshots or read screen contents. Screen Recording and Accessibility permissions are not required for this coordinates-only workflow.

Requirements

  • macOS 13 or later

About

Select a screen region and print coordinates for screencapture or AppleScript

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages