Is there any way to get the scrollbar position of a Safari window? Want to press Space until the end of the HTML document is reached and print a screenshot of every document part.
Thanks for any hints!
PS: Scrolling and screenshotting is really needed as I need to make screenshots. Don’t want to print document at once (e.g. as PDF, PNG, …).
tell application "Safari"
tell document 1
If you want to make a picture of the whole site… try FireFox… there are plugins for that
Great, I am using this code to scroll page wise:
--get document and browser height
--calculate number of pages to screenshot
set pageCount to documentHeight div windowHeight
if documentHeight mod windowHeight > 0 then set pageCount to pageCount + 1
--screenshot every page
repeat with i from 1 to pageCount
-- take screenshot here
--scroll to next page