Sub topic 3
Capture part of the screen
This chapter assumes you know how to press modifier-key shortcuts such as Shift-Command and can find files on the Desktop in Finder. You do not need Terminal for the main steps. A short Terminal example appears near the end.
When to capture a selection
Capturing the whole screen often gets you more than you need. It can include a private notification, a cluttered menu bar, or a second window. A selection capture saves only the rectangle you choose. The result is a smaller image that is easier to share and easier to read.
Take a selection capture
- Press Shift-Command-4. The pointer turns into a crosshair with pixel coordinates beside it.
- Click and drag from one corner of the area to the opposite corner.
- Release the mouse button. The capture is saved right away.
By default, the file is a PNG on the Desktop. Its name starts with "Screenshot" and includes the date and time. A floating thumbnail appears in the lower-right corner for a few seconds.
To cancel before you release the button, press Escape. Nothing is saved.
Adjust the selection while you drag
You can change the selection without starting over. Hold a key while you drag, and the selection behaves differently.
| Key held while dragging | Effect |
|---|---|
| Space | Moves the whole selection without resizing it |
| Shift | Locks one edge, so you can resize in only one direction |
| Option | Resizes the selection from its center |
| Escape | Cancels the capture |
Space is the one you will use most. Drag a rough rectangle, hold Space, and slide the box into place. Release Space to go back to resizing.
Capture a selection from Terminal
The same action is available through the screencapture command. The -i option starts interactive selection, and the last argument is the output file.
screencapture -i ~/Desktop/selection.pngDrag to select an area, just as with the keyboard shortcut. The file is written to the path you gave. Later chapters cover this command in more detail.
Common mistakes
- Nothing happens when you press the shortcut. Another app or a system setting may use the same keys. The chapter on fixing permission and shortcut problems covers this.
- The capture is blank or missing a window. Some apps block capture of protected content, such as certain video players.
- You cannot find the file. Check the Desktop first. If you changed the save location earlier, look there instead.
- The area is slightly off. Use the pixel coordinates beside the crosshair to line up the starting corner before you click.
Check your understanding
Exercise
You press Shift-Command-4 and start dragging, but the rectangle has the right size and the wrong position. How can you fix it without cancelling, and what happens if you press Escape instead?
Show answer
Hold Space while the mouse button is still down, then move the pointer to slide the rectangle into place. Release Space to resize again. Pressing Escape cancels the capture, and no file is saved.
Exercise
Which Terminal command lets you drag to select an area and saves it as selection.png on the Desktop?
Show answer
screencapture -i ~/Desktop/selection.png