Capture an Application Window with screencapture -W

screencapture -W switches to interactive mode so you click the window you want; the shot includes the window shadow unless you pass -o.

macOSwindowScreenshotscreencaptureLow risk
Run `screencapture -W window-shot.png` then click the window to capture just that window with its shadow.

01Command

Command
$ screencapture -W window-shot.png

02What it does

The -W flag enters the same click-to-pick mode as Shift-Cmd-4 then Space in the GUI, so you don't need to look up a numeric window ID. The saved image includes the drop shadow as padding; add -o to get a tight crop of the window itself. If the capture comes out empty, make sure the Terminal app has Screen Recording permission in System Settings → Privacy & Security.

03Risk

RiskLow risk
!Warning: screencapture requires Screen Recording permission for Terminal, otherwise shots may be blank or refused.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Take a screenshot on Mac
    Apple Support · vendor-doc · 2026-09-17
    Evidence: Apple's official instructions for window screenshots, including holding Option while clicking to exclude the shadow.
  • screencapture — create a screen snapshot (macOS man page)
    SS64 · technical · 2026-09-17
    Evidence: Documents screencapture -W to start interaction mode and capture a window selected by clicking, with -o to omit the window shadow.

Last verified: 2026-09-17 · Category: Media

06Related solutions