• 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
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]

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


  • Subject: How do I pause a script to allow a webpage to load and then resume the script?
  • From: Jeffrey L.Porrello <email@hidden>
  • Date: Sun, 13 Dec 2009 13:12:05 -0800

Note: Safari is already active with no open windows.

The script:

activate application "Safari"
set artnum to 0
repeat 1000 times
     open location "http://theknowledgebaseiamaccessing.com/articlenumber=" & artnum
     delay 10
     get name of 1st window of application "Safari"
     if result is ... then
          ...
     ...
          ...
     ...
          ...
     ...
          ...
     ...
          ...
          ...
          ...
     end if
     set artnum to artnum + 1
end repeat


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"

DOES ANYONE KNOW HOW TO DO THIS???


You get the idea. Instead of using a fixed delay of "x" number of seconds, I would prefer a way to pause just long enough for the page to finish loading before moving on with the script. This would prevent the problems that crop up when a page hasn't fully loaded before being passed on to the filtering stage of the script. It would also speed things along since most pages load in less, rather than more time.

Any help would be greatly appreciated

Jeff P.
 _______________________________________________
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

  • Follow-Ups:
    • Re: How do I pause a script to allow a webpage to load and then resume the script?
      • From: "email@hidden" <email@hidden>
    • Re: How do I pause a script to allow a webpage to load and then resume the script?
      • From: Emmanuel LEVY <email@hidden>
  • Prev by Date: Re: Modified "modification date"
  • Next by Date: get row number of first empty cell in Excel
  • Previous by thread: Re: RRe: Modified "modification date"
  • Next by thread: Re: How do I pause a script to allow a webpage to load and then resume the script?
  • Index(es):
    • Date
    • Thread