Skip to content

Instantly share code, notes, and snippets.

@rysk-t
Created February 1, 2016 04:27
Show Gist options
  • Select an option

  • Save rysk-t/b389c18280ce5357bf7f to your computer and use it in GitHub Desktop.

Select an option

Save rysk-t/b389c18280ce5357bf7f to your computer and use it in GitHub Desktop.
set dirname to (getTimeStamp() as string) -- 時間で
do shell script "mkdir ~/Data/scrs/" & dirname & "/" -- ディレクトリ作成
repeat with p from 1 to 110 -- ページ数
set pstr to p
set pstr to text -3 thru -1 of ("00" & pstr)
set tgt_file to "ssw" & "scr" & "_" & (pstr) & ".jpg"
-- 出力するファイル名を「sswyyyymmddhhmmss.jpg」に。
tell application "Kindle 2" -- 通常 "Kindle" でよい
activate -- ウインドウフォーカスを移す
tell application "System Events"
delay 1
do shell script "screencapture " & "~/Data/scrs/" & dirname & "/" & tgt_file
key code 123 -- 矢印キーによるぺーじおくり
end tell
end tell
-- ウィンドウを選択してチャプチャーし、上記のファイル名で出力。
end repeat
on getTimeStamp()
set localdate to (current date)
set y to year of localdate as number
set m to month of localdate as number
set d to day of localdate as number
set h to hours of localdate as number
set mi to minutes of localdate as number
set ss to seconds of localdate as number
set msg to m & d & h & mi & ss
end getTimeStamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment