Last active
January 13, 2023 08:49
-
-
Save takahashilabo/38b8f28f6367274dd813114f5e057436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
page=10 #Kindleのページ数をいれる | |
wid=7374 #brew install smokris/getwindowid/getwindowid でインストールして「getwindowid Kindle --list」を実行した書籍のウィンドウIDを取得していれる | |
osascript -e 'tell application "Kindle" to activate' | |
while (( page-- > 0)); do | |
/usr/sbin/screencapture -l$wid -x -r o/c_`ls o/*png | wc -w | sed 's/^[[:blank:]]*//'`.png | |
osascript -e 'tell application "System Events" to keystroke (ASCII character 29)' | |
sleep 0.5 #マシン速度によってキャプチャが間に合わない場合は長くする | |
done |
getwindowid Kindle '' --listを修正
上が間違いだったので再度、getwindowid Kindle --listに修正
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
固定レイアウト型のKindle本を読み上げたいのでなんとか画像ファイル化してOCRかけたかったので作ったお手製ツール。