• 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
I need to allow a web page to fully load before saving it with my script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I need to allow a web page to fully load before saving it with my script


  • Subject: I need to allow a web page to fully load before saving it with my script
  • From: Jeff Porrello <email@hidden>
  • Date: Tue, 14 Sep 2010 23:16:48 -0700 (PDT)

I need to allow a web page to fully load before saving it with my script.

I have written a script which automatically downloads Knowledge Base documents from Apple's Support web site (I am a technical information hound). I use the "Open Location" command to open a particular web page. I need the page to fully load before issuing the "Save As..." command. Does anyone know how to write this portion of a script?

Any help would be GREATLY appreciated!

Thank You!

activate application "Safari"

set artnum to 3

repeat 78000 times

open location "http://docs.info.apple.com/article.html?artnum=" & artnum

I WOULD LIKE TO INSERT THE NEEDED PIECE OF SCRIPT HERE

get name of 1st window of application "Safari"

if result is "AppleCare" then

close 1st window of application "Safari"

else if result is "We're sorry. (404)" then

close 1st window of application "Safari"

else if result is "Apple - Login" then

close 1st window of application "Safari"

else if result is "403 Forbidden" then

close 1st window of application "Safari"

else if result is "Apple - Support - Downloads" then

close 1st window of application "Safari"

else

get name of 1st window of application "Safari"

if result is "AppleCare Knowledge Base" then

tell application "System Events"

tell process "Safari"

key down command

keystroke "r"

key up command

AND HERE

end tell

end tell

end if

tell application "System Events"

tell process "Safari"

key down command

key down shift

keystroke "s"

key up shift

key up command

delay 2

keystroke return

end tell

end tell

delay 2

close 1st window of application "Safari"

end if

set artnum to artnum + 1

end repeat



Thanks Again!

 _______________________________________________
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: I need to allow a web page to fully load before saving it with my script
      • From: "email@hidden" <email@hidden>
    • Re: I need to allow a web page to fully load before saving it with my script
      • From: Thomas Fischer <email@hidden>
    • Re: I need to allow a web page to fully load before saving it with my script
      • From: Emmanuel LEVY <email@hidden>
  • Prev by Date: Re: set vs copy?
  • Next by Date: Re: I need to allow a web page to fully load before saving it with my script
  • Previous by thread: Re: set vs copy?
  • Next by thread: Re: I need to allow a web page to fully load before saving it with my script
  • Index(es):
    • Date
    • Thread