• 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
Checking whether a website has loaded completely
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking whether a website has loaded completely


  • Subject: Checking whether a website has loaded completely
  • From: Peter Fischer <email@hidden>
  • Date: Thu, 23 May 2002 22:29:32 +0200

Hi Scripters,

I'm currently scripting Internet Explorer to reload a website.
There's no problem with the reload, but I want to restore the scroll positions of the window.

The following script works:
--------------------------------------------------------------------------------
tell application "Internet Explorer"
Activate

set XScroll to do script "document.body.scrollLeft" window 1
--> "115!
set YScroll to do script "document.body.scrollTop" window 1
--> "715"
do script "location.reload()" window 1
--> "undefined"

delay 5

do script "window.scrollTo(" & XScroll & "," & YScroll & ")" window 1
--> "undefined"
end tell
--------------------------------------------------------------------------------

The commented values under each line are the returned values.

The problem is that the script has to wait until the website has loaded completely.
Then it will work to scroll to the stored positions.

How can I determine whether the site has loaded?

I've tried:

do script "window.captureEvents(Event.LOAD) window 1

but this returns no value!

--
Peter Fischer
Fischer-Bayern
"The source for german AppleScripters"
http://www.fischer-bayern.de
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Checking whether a website has loaded completely
      • From: Bjorn Van Blanckenberg <email@hidden>
  • Prev by Date: Use Applescript to ping and address ?
  • Next by Date: File IO Handlers
  • Previous by thread: Re: Use Applescript to ping and address ?
  • Next by thread: Re: Checking whether a website has loaded completely
  • Index(es):
    • Date
    • Thread