Macでスクリーンショットを5秒おきに12時間撮影する方法。
FXのスプレッドを12時間確認したくて、5秒おきにスクショを録るソフトを探してまして...
スクリーンショットのタイムラプス的なものを撮影したかったのです。
普通に動画撮影すると、動画が50GBになったりします。それは大丈夫なんですが、そこから編集すると時間がすごい掛かりますのでファイルを軽くしたくてスクショでいこうと思ってます。
いろいろ試したんですが、windowsにはいいソフトがないので、結局MACのコマンドを応用して作って見ました。
ご存知の通り、macにはコマンドというもんがありましてターミナルで使えます。
これですね。
「screencapture」というコマンドを使用すると、スクショを録れます。
オプションとしてはこんな風にいっぱいあります。
screencapture: illegal option -- T
usage: screencapture [-icMPmwsWxSCUtoa] [files]
-c force screen capture to go to the clipboard
-b capture Touch Bar - non-interactive modes only
-C capture the cursor as well as the screen. only in non-interactive modes
-d display errors to the user graphically
-i capture screen interactively, by selection or window
control key - causes screen shot to go to clipboard
space key - toggle between mouse selection and
window selection modes
escape key - cancels interactive screen shot
-m only capture the main monitor, undefined if -i is set
-D<display> screen capture or record from the display specified. -D 1 is main display, -D 2 secondary, etc.
-o in window capture mode, do not capture the shadow of the window
-p screen capture will use the default settings for capture. The files argument will be ignored
-M screen capture output will go to a new Mail message
-P screen capture output will open in Preview or QuickTime Player if video
-I screen capture output will open in Messages
-B<bundleid> screen capture output will open in app with bundleid
-s only allow mouse selection mode
-S in window capture mode, capture the screen not the window
-J<style> sets the starting of interfactive capture
selection - captures screen in selection mode
window - captures screen in window mode
video - records screen in selection mode
-t<format> image format to create, default is png (other options include pdf, jpg, tiff and other formats)
-T<seconds> take the picture after a delay of <seconds>, default is 5
-w only allow window selection mode
-W start interaction in window selection mode
-x do not play sounds
-a do not include windows attached to selected windows
-r do not add dpi meta data to image
-l<windowid> capture this windowsid
-R<x,y,w,h> capture screen rect
-v capture video recording of the screen
-V<seconds> limits video capture to specified seconds
-g captures audio during a video recording using default input.
-G<id> captures audio during a video recording using audio id specified.
-k show clicks in video recording mode
-U Show interactive toolbar in interactive mode
-u present UI after screencapture is complete. files passed to command line will be ignored
files where to save the screen capture, 1 file per screen
例えば5秒後にスクショを撮って「デスクトップのscreenshot」というフォルダーに「01.png」を保存するにはこんなコマンドです。
screencapture -T 5 ~/Desktop/screenshot/01.png
さらに5秒おきにスクショを撮影したい場合にはこんなファイルを作りました。
最初に「screenshot_auto」を削除して今あるファイルを消します。
次に「screenshot_auto」というフォルダーを作ります。
そして5秒おきにスクショを「screenshot_auto」というフォルダーに保存します。
rm -r ~/Desktop/screenshot_auto/
mkdir ~/Desktop/screenshot_auto/
screencapture -T 5 ~/Desktop/screenshot_auto/01.png
screencapture -T 5 ~/Desktop/screenshot_auto/02.png
screencapture -T 5 ~/Desktop/screenshot_auto/03.png
screencapture -T 5 ~/Desktop/screenshot_auto/04.png
screencapture -T 5 ~/Desktop/screenshot_auto/05.png
screencapture -T 5 ~/Desktop/screenshot_auto/06.png
screencapture -T 5 ~/Desktop/screenshot_auto/07.png
screencapture -T 5 ~/Desktop/screenshot_auto/08.png
screencapture -T 5 ~/Desktop/screenshot_auto/09.png
screencapture -T 5 ~/Desktop/screenshot_auto/10.png
このファイルをsc1というファイルにしました。これは例なので10回しかスクショしないようにしか書いてませんが、ファイル自体は7,200回までスクショする様にしてます。
7,200回は10時間分です。10時間 = 3,6000秒を5秒おきにスクショした場合、7,200回します。
余談ですけど、実行しようとしたら権限なかったので権限追加しました。
chmod 755 sc1
これでファイルを実行できる様になりました。
以下ダウンロードして使える様にしました。
ダウンロードについて
ダウンロード
1. こちらのリンクからダウンロードしてください。
https://www.dropbox.com/s/2kpdvgbm681xwon/sc1.zip?dl=0
2.こちらのリンクからTradersCafeのLINE@に登録してください。
https://line.me/R/ti/p/%40253gnfan
3. 「pw1」と入力すると、自動返信でパスワードの一覧をお知らせします。
4. zipファイルを解凍する際に、パスワードを入力してください。
ダウンロード方法の詳細についてはこちらをご覧ください。
この記事が気に入ったらサポートをしてみませんか?