【Mac】OS X スクリーンショットのファイル名やファイル形式などの変更方法

2013/10/17 19:59

Mac OS Xでのスクリーンショットを撮るときに覚えておくと便利な設定方法をまとめておきます。

週刊アスキーPLUS」さんで、スクリーンショットのファイル名を変更する方法について紹介されていたんですが、情報が断片的だったので備忘録も兼ねてTipsを残しておきます。

OS X:スクリーンショットを撮る方法

画面全体のスクリーンショットを撮る
「command (⌘) + shift + 3」キーを押します。スクリーンショットがデスクトップに追加されます。

画面の一部のスクリーンショットを撮る
「command (⌘) + shift + 4」キーを押して、十字ポインタをドラッグして領域を選択します。「shift」「option」または「space」バーを押しながらドラッグして、選択した領域のサイズを変更します。取り消すには、マウスボタンを放す前に「escape (esc)」キーを押します。
特定のウインドウのスクリーンショットを撮る
「command (⌘) + shift + 4」キーを押して「space」バーを押し、カメラのポインタをウインドウの上に移動してハイライトし、クリックします。
この方法でSSを撮ると、自動的に影が付きます。

影を付けたくない場合、Optionキーを押しながらクリックするとOKです。
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
defaults write com.apple.screencapture disable-shadow -bool false
killall SystemUIServer
via. http://support.apple.com/kb/HT5775?viewlocale=ja_JP

スクリーンショットのファイル名を変更する方法


デフォルトだと先頭に「スクリーンショット」と名前が付くので、長いファイル名になってしまいます。

変更するには、ターミナルから以下のようにコマンドを入力します。

名前を「SS」に設定したい場合

defaults write com.apple.screencapture name "SS"
先頭の名前を表示させない場合

defaults write com.apple.screencapture name ""
defaults write com.apple.screencapture name "スクリーンショット"
ファイル名に日付を入れない場合
defaults write com.apple.screencapture include-date -bool false
defaults delete com.apple.screencapture include-date
もし先頭の文字を入れずに日付も消すとこうなります。(サムネイルが表示されない)
個人的におすすめの設定

defaults write com.apple.screencapture name "SS"
defaults write com.apple.screencapture include-date -bool false

スクリーンショットの保存先を変更する

デフォルトではデスクトップに保存されますが、以下のようにコマンドを入力することで変更できます。

defaults write com.apple.screencapture location "~/Documents"
killall SystemUIServer
location “変更したい場所"なので、ターミナル上へドラッグ・ドロップしてあげれば簡単です。もとに戻す場合は「location “~/Desktop"」になります。

保存されるファイルの種類をJPGなどに変更する

デフォルトではPNGなので、ファイルサイズが大きくなります。

defaults write com.apple.screencapture type JPG
killall SystemUIServer
「JPG」の部分を変えることで、他の形式でも保存ができます。

PNG, PDF, JPG, JP2, GIF, TIF, BMP, PICT, TGA
他にもターミナルからスクリーンショットを撮ることができます。

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

Tweak Screencapture Behavior | UsingMac.com

「man screencapture」で詳細を確認できます。
(終了は、Ctrl+x Ctrl+z)
-c Force screen capture to go to the clipboard.
-C Capture the cursor as well as the screen. Only allowed in non interactive modes.
-i Capture screen interactively, by selection or window. The control key will cause the screen shot to go to the clipboard. The space key will toggle between mouse selection and window selection modes. The escape key will cancel the interactive screenshot.
-m Only capture the main monitor, undefined if -i is set.
-M Open the taken picture in a new Mail message.
-o In window capture mode, do not capture the shadow of the window.
-P Open the taken picture in a Preview window.
-s Only allow mouse selection mode.
-S In window capture mode, capture the scre
-t Image format to create, default is png (other options include pdf, jpg, tiff and other formats).
-T Take the picture after a delay of , default is 5.
-w Only allow window selection mode.
-W Start interaction in window selection mode.
-x Do not play sounds.
-a Do not capture attached windows.
-r Do not add screen dpi meta data to captured file.
files where to save the screen capture, 1 file per screenen instead of the window.
以上、ご参考まで!