I wanted to use screencapture
to take a screenshot of all monitors from within a script, but this only seems to capture the main monitor. How can I use screencapture
or any other tool callable from the command line to capture all monitors?
How to take a screenshot from all monitors with screencapture or other tools
displayscreen capture
Related Question
- MacOS – How to post a screenshot from Mac OS X Lion on askdifferent
- How to Take a Screenshot from Spotlight – Keyboard and Automator Tips
- AppleScript – Take Screenshot of Screenshot
- How to Take a Screenshot on Mac While Keeping Aspect Ratio
- MacOS – How to highlight text on a screenshot using Markup in macOS
- How to Take Screenshots of a Specific Window Using Command Line
- macOS – How to Take a Screenshot During Screen Sharing
Best Answer
It's poorly documented, but it is indeed possible with the
screencapture
command.Here's the relevant section from
man screencapture
:Of course, if you're calling it programmatically, you might not know how many monitors there are, so you'll have to parse the output of
system_profiler SPDisplaysDataType
ordefaults read /Library/Preferences/com.apple.windowserver.plist
to determine how many filename arguments to pass toscreencapture
. For example:References
https://stackoverflow.com/questions/20099333/terminal-command-to-show-connected-displays-monitors-resolutions
http://hintsforums.macworld.com/showthread.php?p=695603