Safari ブラウザの下の方へスクロールする方法
これが1番いいやり方かどうかは、わからない。
ダメなやり方だった。
on setScrollBottom() -- NG
tell application "System Events"
tell application "Safari" to activate
delay 0.5
repeat 1500 times
key code 121 -- down key
end repeat
end tell
end setScrollBottom
JavaScript でやる方がキレイ。
on scrollBottom()
tell application "Safari"
set val to do JavaScript "
var element = document.documentElement;
var bottom = element.scrollHeight - element.clientHeight;
window.scroll(0, bottom);
" in document 1
end tell
end scrollBottom