Skip to content

Instantly share code, notes, and snippets.

@takahashilabo
Created December 4, 2023 04:58
Show Gist options
  • Save takahashilabo/119d593cc6628d942750c2a0283983b4 to your computer and use it in GitHub Desktop.
Save takahashilabo/119d593cc6628d942750c2a0283983b4 to your computer and use it in GitHub Desktop.
#!/bin/bash
read -p "page no => " page
getwindowid "Kindlei Classic" --list
#brew install smokris/getwindowid/getwindowid でインストールする.
read -p "window id => " wid
osascript -e 'tell application "Kindle" to activate'
sleep 2
while (( page++ < 1000)); do
/usr/sbin/screencapture -l$wid -t jpg -r o/c_$page.jpg
# osascript -e 'tell application "System Events" to keystroke (ASCII character 29)'
osascript -e 'tell application "System Events" to keystroke (ASCII character 28)'
sleep 1 #マシン速度によってキャプチャが間に合わない場合は長くする
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment