Re: How to save the Safari front window contents by script
Re: How to save the Safari front window contents by script
- Subject: Re: How to save the Safari front window contents by script
- From: "Nigel Garvey" <email@hidden>
- Date: Sat, 3 Mar 2007 21:36:22 +0000
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden