Re: Detecting when URL has been loaded in Safari???
Re: Detecting when URL has been loaded in Safari???
- Subject: Re: Detecting when URL has been loaded in Safari???
- From: Philip Aker <email@hidden>
- Date: Tue, 29 Sep 2009 05:10:19 -0700
On 2009-09-29, at 02:18:22, Dave wrote:
I have a script that open a Web Page, call it www.mydomain.com/something
. The requirement is to have only one Safari Window open to the "www.mydomain.com
". My Script scans each window in Safari and closes windows that are
set to "www.mydomain.com" if there is more than one open. All works
well generally, but (why is there always a "but' ?!?), but the first
time I run the Script I get two windows after my Script has ended. I
think the reason is that the first URL is requested and the Script
continues and exits, then it is called again before the first
request has actually loaded into Safari, so it doesn't return the
URL of the window that is loading and it opens a second window!
My question is this:
After doing this:
set myWIndow to (make new document with properties {URL: myURL})
is there any way to wait until this URL has 100% loaded before
continuing?
I think if you search the archives of this list you will find a
javascript snippet that attempts to do that. Sorry I can't remember
the term right now but maybe if you searched on "do JavaScript" or
"document.readyState"…
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
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