• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Safari scroll bar problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari scroll bar problem


  • Subject: Re: Safari scroll bar problem
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 01 Sep 2016 17:13:26 +1000

On 1 Sep 2016, at 3:56 PM, Brian Christmas <email@hidden> wrote:

it scrolls each site ten times, then closes that page, and scrolls the next, etc. However, some sites are so long, that 10 times is not enough to fully display the site, and therefore may not duplicate the freezing conditions. So, I monitor the scroll position, and if it has not reached 1.0, keep scrolling up to 100 times.

You'll need to turn on "Allow _javascript_ from Apple Events" in the Develop menu:

tell application id "com.apple.Safari" -- Safari.app
set theTab to current tab of window 1
set jumpSize to (do _javascript_ "window.innerHeight;" in theTab) / 2
do _javascript_ "window.scrollTo(0,0);" in theTab
set docHt to do _javascript_ "document.body.clientHeight;" in theTab
repeat with i from 1 to (docHt div jumpSize) + 1
do _javascript_ "window.scrollTo(0," & i * jumpSize & ");" in theTab
delay 0.2 -- whatever
end repeat
end tell

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Next by Date: Re: Safari scroll bar problem
  • Next by thread: Re: Safari scroll bar problem
  • Index(es):
    • Date
    • Thread