Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to save the Safari front window contents by script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



At 9:36 PM +0000 3/3/07, Nigel Garvey wrote:
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

That's excellent, I think, but if this is to be called in a script just after loading the page I would advise inserting first a tiny delay because for a very short while after you've instructed Safari to load a new page it may first return "complete".


Emmanuel
_______________________________________________
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: 
 >Re: How to save the Safari front window contents by script (From: "Nigel Garvey" <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.