• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
page loading in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

page loading in Safari


  • Subject: page loading in Safari
  • From: Jim Brandt <email@hidden>
  • Date: Fri, 17 Oct 2008 10:10:22 -0500

I'm having trouble with pages not loading in Safari. This is a script that normally runs with little trouble, until lately, because Comcast seems to have slowed considerably in my area opening pages in a reasonable time. So I want to put a time limit on the page opening
process. The only way I could think of to test this was by putting in a counter, and updating it once a second while testing the window name of Safari.

Here's a snippit of the code I'm using:

... other parts of script here

tell application "System Events"
    tell process "Safari"
        click UI element "Portfolio Positions" of group 19 of UI element 1 of scroll area 1 of group 3 of window "Fidelity: Portfolio"
        delay 3
        set _page_loaded to false
        set _loop_count to 0
        repeat until (_page_loaded or _loop_count > 179)
            delay 1
            set _loop_count to _loop_count + 1
            set _page_loaded to exists window "Fidelity: Portfolio Positions"
        end repeat
        if not _page_loaded then
            set the _current_time to the time string of the (current date)
            set _mess to _current_time & " - Portfolio Positions page not opened in 3 minutes"
            tell me to Message(_mess, _log) of My_Lib -- log it
            say _mess using "Vicki"
            error number -128
        end if

... remainder of script


While this does work, I feel that it is rather cumbersome. Is there a better way to ensure that a page in Safari is loaded within a particular time period?

Jim Brandt
 _______________________________________________
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

  • Prev by Date: Re: .mac sync now
  • Next by Date: Re: .mac sync now
  • Previous by thread: Indesign & offsetting image within frame.
  • Next by thread: scripting iDVD
  • Index(es):
    • Date
    • Thread