MACSCRPT Archives

August 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 30 Aug 2011 22:53:16 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
On Aug 30, 2011, at 7:00 PM, MACSCRPT automatic digest system wrote:
> 
> --
> Best Regards,
> Chris
> 
> -------------------------------------------------------------------------------
> on page_loaded(timeout_value)
>  delay 2
>  repeat with i from 1 to the timeout_value
>    tell application "Safari"
>      if (do JavaScript "document.readyState" in document 1) is "complete" then
>        return true
>      else if i is the timeout_value then
>        return false
>      else
>        delay 1
>      end if
>    end tell
>  end repeat
>  return false
> end page_loaded
> -------------------------------------------------------------------------------
> tell application "Safari"
>  # activate
>  # LOAD URL
>  make new document with properties {URL:SITE_URL}
>  set bounds of front window to {0, 22, 1038, 1024}
>  # WAIT FOR LOADING COMPLETE
>  page_loaded(1) of me
>  delay 1.5
>  set docSource to source of document 1
> end tell

Thank you, Ed

ATOM RSS1 RSS2