Tweak Screencapture Behavior (MAC)

Tweak Screencapture Behavior (MAC)

Normally, we will use keystrokes Cmd-Shift-3 or Cmd-Shift-4 to take snapshot with Mac default screencapture utility. And new in Snow Leopard, we will end up having a PNG image file automatically stored inside our Desktop folder with the name Screen shot

Those behaviors mentioned above are the default ones. We can of course easily change those with simple command lines on the terminal…

  1. Change Screencapture Filename
    defaults write name "New Name"

    killall SystemUIServer

    You can change the value "New Name" to the name of your liking. And if you put the name as empty string (i.e. ""), you will get your screencapture named with the format: [current date] at [time], e.g. "2009-10-20 at AM 03.02.57".

  2. Change Screencapture Location
    defaults write location "New Location"
    killall SystemUIServer

    Hint: You can drag-drop the folder to Terminal pane to get the folder location.
    As seen in both command lines, the second line killall SystemUIServer is needed and used to restart the screencapture application. Only after restarting, changes will take effect.

  3. Change Screencapture File Format
    defaults write type [new format]
    killall SystemUIServer

    These file formats are available: PNG, PDF, JPG, JP2, GIF, TIF, BMP, PICT, and TGA.
    Note. Replace the [new format] with one of those available formats, e.g. JPG.

  4. Disable Window Shadow
    When we used key combination [Cmd-Shift-4] + [Space], we will be able to capture a snapshot of window along with the shadow. The following command lines are used to disable the shadow.
    defaults write disable-shadow -bool true
    killall SystemUIServer

    You can change -bool true to -bool false to enable back the shadow.

  5. Capture from Terminal Command
    One of these command lines can be used to capture from terminal:
    screencapture -c
    screencapture -i ~/Desktop/snapshot.png
    screencapture -io ~/Desktop/screenshot.png
    screencapture -M ~/Desktop/screenshot.png
    screencapture -P ~/Desktop/screenshot.png
    screencapture -t png ~/Desktop/screenshot.png
    screencapture -T 5 ~/Desktop/screenshot.png
    screencapture -x ~/Desktop/screenshot.png

    The usages of each command line can be checked using: man screencapture

[ source ]



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.