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

Re: Checking whether a website has loaded completely


  • Subject: Re: Checking whether a website has loaded completely
  • From: Bjorn Van Blanckenberg <email@hidden>
  • Date: Fri, 24 May 2002 11:58:31 +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

-> I think you donb't need the delay


set frontmost_window to item 1 of {ListWindows}
set wait_flag to ""

repeat until wait_flag = "complete"
set CurrentURL to do script "document.location"
set wait_flag to do script "document.readyState" window frontmost_window
end repeat

>
> 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!

--
Oooo.
oooO ( )
( ) ) /
\ ( (_/
\_)


Bjorn Van Blanckenberg
_______________________________________________
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: Peter Fischer <email@hidden>
References: 
 >Checking whether a website has loaded completely (From: Peter Fischer <email@hidden>)

  • Prev by Date: Re: OSAX on X
  • Next by Date: Re: Beginner here
  • Previous by thread: Checking whether a website has loaded completely
  • Next by thread: Re: Checking whether a website has loaded completely
  • Index(es):
    • Date
    • Thread