Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to save the Safari front window contents by script



email@hidden wrote on Sat,  3 Mar 2007 14:37:41 +0100 (CET):

>In the mean time (between the mail sent time and your answers), I realized
>that I need to add a timing (wait) between sending the URL requests to
>Safari and the moment I save the document to disk: I saved nth time the
>'nearly the same' file. But, a simple search in the
>AppleScriptLanguageGuide.pdf gives me the "delay" command. Now, I have to
>make some testings to get a proper wait time (delay to get hte asked
>document from the Yahoo file server).

Hi, emile. You can use Safari's 'do JavaScript' command to tell you when
the page has finished loading:

  tell application "Safari"
    repeat until ((do JavaScript "document.readyState" in front document)
is "complete")
      delay 0.2
    end repeat
  end tell


NG

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.