【Mac】いろいろな画面キャプチャ(スクリーンショット)の取り方
こんにちは
よく使う画面キャプチャ。 範囲選択して保存する方法はバッチリなのですが、その他は毎回忘れるのでメモ
画面全体
Command + Shift + 3
※ Control を押しながらやるとクリップボードにコピー デフォルト(初期状態)はデスクトップにファイルが作成される
スクリーンショットの保存先変更
変更していない場合はデスクトップに保存されますが、指定したフォルダに保存したい場合は コンソール画面から以下のコマンドを入力
$ defaults write com.apple.screencapture location ~/Pictures/
SystemUIServerを再起動し、設定を反映します。
$ killall SystemUIServer
戻すとき
$ defaults delete com.apple.screencapture location $ killall SystemUIServer
任意のサイズ
Command + Shift + 4 を同時に押してから、任意の箇所をマウスで選択
任意のウィンドウ
Command + Shift + 4 を同時に押してからスペースを押すと、アイコンがカメラになる。その状態で任意のウィンドウをクリック
任意のウィンドウから影をなくす
ググってみるとよく
- 影をなくす時は
MacのFinderから「アプリケーション」→「ユーティリティ」にアクセスし、「ターミナル」を起動します。以下のコマンドを実行します。 $ defaults write com.apple.screencapture disable-shadow -boolean true SystemUIServerを再起動し、設定を反映します。 $ killall SystemUIServer
- 影ありに戻す時は
影ありに戻したい場合は、以下のコマンドを実行すればOKです。 $ defaults write com.apple.screencapture disable-shadow -boolean false SystemUIServerを再起動し、設定を反映します。 $ killall SystemUIServer
なんてことが書いてあるけど、実はそんなのは不要です。 (デフォルトを影ナシにするならありですけど。)
任意のウィンドウをキャプチャするときと同じく
Command + Shift + 4 のあとスペースを押して、カメラアイコンの状態でOptionを押しながらウィンドウを選択すればOK
Option キー、素晴らしい!
ちなみに「任意のサイズ〜」のやり方で Option キーを押しながらやると、 選択した場所を中心にサイズが決められます。 あまり使うシーンが思い浮かびませんがね。
スクロールが必要なWebページをキャプチャ
スクリーンショットのファイル形式を変更する
「.jpeg形式」に変更するには、ターミナルに以下のコマンドを入力
$ defaults write com.apple.screencapture type jpg
いつも通りSystemUIServerを再起動します。
$ killall SystemUIServer
スクリーンショットの名称変更
デフォルトのファイル名はこんなの
スクリーンショット 2016-01-15 17.05.55
defaults write com.apple.screencapture name "スクショ" ←変更する文字
SIPモードの説明 SIPモードをdisbled に変更すると編集可能になる
xmlに変換して編集する
cd /System/Library/CoreServices/SystemUIServer.app/Contents/Resources/Japanese.lproj sudo plutil -convert xml1 ScreenCapture.strings sudo vim ScreenCapture.strings
このxmlファイルを編集するとスクショのファイル名を変更できます
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>%@ %@</key> <string>%@ %@</string> <key>%@ %@ at %@</key> <string>%@ %@ %@</string> ←「ファイル名 年月日 時刻」の 半角スペース部分 <key>%@ %@(%@)</key> <string>%@ %@(%@)</string> <key>%@ (%@)</key> <string>%@(%@)</string> <key>-</key> <string>-</string> ←「2016-01-15」 のハイフンの部分 <key>.</key> <string>.</string> ←「17.05.55」 のドット「.」の部分
こんな感じに編集すると
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>%@ %@</key> <string>%@ %@</string> <key>%@ %@ at %@</key> <string>%@%@_%@</string> ←「ファイル名 年月日 時刻」の 半角スペース部分 <key>%@ %@(%@)</key> <string>%@ %@(%@)</string> <key>%@ (%@)</key> <string>%@(%@)</string> <key>-</key> <string></string> ←「2016-01-15」 のハイフンの部分 <key>.</key> <string></string> ←「17.05.55」 のドット「.」の部分
この状態だと保存時のファイル名はこうなります
スクショ20160115_170555
最後にxmlファイルを元に戻して変更を反映
sudo plutil -convert binary1 ScreenCapture.strings killall SystemUIServer