mockroNotes -モックロノート-

ガジェットやイラスト、ワークアウトに関心を示すブログです

MacOS Xでスクリーンショットを撮る方法と保存先を変える方法

f:id:mockro:20210622103512p:plain

ドキュメント(マニュアル)作成時にお世話になるスクリーンショット(スクリーンキャプチャー)機能。ちょっと設定を変えるたびに設定方法を検索しているのでここにメモしておきます。

MacOS Xでスクリーンショットを撮るショートカットキー

基本的にはショートカットキーでスクリーンショットを撮る。キーは以下の通り。

画面全体を撮る

Command + Shift + 3

マウスで範囲を選択して撮る

Command + Shift + 4

ウィンドウを選択して撮る

Command + Shift + 4でカーソルが変わったらspace

これらを押す(実行する)とデスクトップに.png形式で保存される。

ファイル名を変更する

通常「スクリーンショット 2018-09-27 12.00.00」のようなファイル名で保存されますが、これを変更するにはこちら。

「スクリーンショット」部分を消す

% defaults write com.apple.screencapture name ""

「スクリーンショット」部分を他の名前に変更する

% defaults write com.apple.screencapture name "screencapture"

デフォルトに戻す場合は「screencapture」部分を「スクリーンショット」に設定しましょう。

日付を消す

% defaults write com.apple.screencapture include-date -boolean false

日付をつける場合

% defaults write com.apple.screencapture include-date -boolean true

SystemUIServerを再起動

ファイル名の指定が完了したらSystemUIServerを再起動しましょう。これで設定が反映されるはずです。

% killall SystemUIServer

保存形式を変える

上記で保存されるファオーマットを変えたい場合は、ターミナルを起動してコマンドラインで設定します。

jpg形式

% defaults write com.apple.screencapture type jpg

gif形式

% defaults write com.apple.screencapture type gif

tiff形式

% defaults write com.apple.screencapture type tiff

pdf形式

% defaults write com.apple.screencapture type pdf

png形式(デフォルトに戻す)

% defaults write com.apple.screencapture type png

SystemUIServerを再起動

フォーマットの指定が完了したらSystemUIServerを再起動。

% killall SystemUIServer

シャドウ無しのウィンドウスクリーンショットを撮る

ウィンドウを選択してスクリーンショット撮ると、ウィンドウのシャドウも一緒に記録されますが、このシャドウを除外する場合はこちら。 これもコマンドラインで設定します。

ウィンドウのシャドウを除外

% defaults write com.apple.screencapture disable-shadow -boolean true

SystemUIServerを再起動

% killall SystemUIServer

ウィンドウのシャドウを含める(デフォルトに戻す)

% defaults write com.apple.screencapture disable-shadow -boolean false

Re:SystemUIServerを再起動

シャドウ有無の指定が完了したらSystemUIServerを再起動。

% killall SystemUIServer

保存先の変更

通常スクリーンショットはデスクトップに保存されますが、これを変更したい場合はこちら。

例:「~/Pictures/sc/」に保存する

% defaults write com.apple.screencapture location ~/Pictures/sc/

/Pictures/sc/の部分をお好みで変更しましょう。

デスクトップに保存する(デフォルトに戻す)

% defaults delete com.apple.screencapture location

Re:SystemUIServerを再起動

保存先の指定が完了したらSystemUIServerを再起動しましょう。

% killall SystemUIServer