• 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: How do I pause a script to allow a webpage to load and then resume the script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I pause a script to allow a webpage to load and then resume the script?


  • Subject: Re: How do I pause a script to allow a webpage to load and then resume the script?
  • From: "email@hidden" <email@hidden>
  • Date: Sun, 13 Dec 2009 17:33:46 -0800


It is the 5th line (the delay line) I would like to modify. I would like it to say in essence: "wait until the page has finished loading"

 
This is what I use (derived from a thread on this list a while back):

set artnum to 0
set thisURL to "http://apps.facebook.com/ea_scrabble_closed/"
tell application "Safari" to set URL of front document to thisURL
delay 1
repeat with i from 1 to 60
tell application "Safari" to set docLoadingState to do _javascript_ "document.readyState" in document 1
if docLoadingState = "complete" then
exit repeat --the page has successfully loaded
else
delay 1
end if
end repeat 

HTH

ES
 _______________________________________________
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

References: 
 >How do I pause a script to allow a webpage to load and then resume the script? (From: Jeffrey L.Porrello <email@hidden>)

  • Prev by Date: Re: get row number of first empty cell in Excel
  • Next by Date: Re: Odd File Write Issue
  • Previous by thread: Re: How do I pause a script to allow a webpage to load and then resume the script?
  • Next by thread: get row number of first empty cell in Excel
  • Index(es):
    • Date
    • Thread