• 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
AppleScript and Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AppleScript and Safari


  • Subject: AppleScript and Safari
  • From: "Steve Suranie" <email@hidden>
  • Date: Tue, 9 Nov 2004 08:05:07 -0500
  • Thread-topic: HTML and Applescript?

	This is a two part question.

	1. Is there a way to script Safari so it will download files to my hard drive (I want to download some XML files on a redundant basis).
	2. If not, is there a way for AppleScript to know when a page in Safari has loaded? I wrote a script that just went to the xml file and was trying to read the source but I kept getting an error - I think the script runs faster than the page can load and thus, the variable I set to hold the source is not valid when I try to return it (see code below). What I was thinking was something on the same line of the "bzy" file type for files that are busy.

> tell application "Safari"
> 	make new document with properties {URL:"http://www.smartmoney.com/rss/smheadlines.cfm?feed=2&format=RSS091"}
> 	with timeout of 120 seconds
> 		set theSource to source of front document
> 	end timeout
> end tell
>
I get an error message that reads: variable theSource is undefined.


If I have the page preloaded and run a script to just read the source code it works fine, which is why I think the script is running faster than the browser can load the page.

Any help is appreciated.




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: AppleScript and Safari
      • From: Dave Balderstone <email@hidden>
    • Re: AppleScript and Safari
      • From: Doug McNutt <email@hidden>
    • Re: AppleScript and Safari
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Script Libraries
  • Next by Date: RE: AppleScript and Safari
  • Previous by thread: Re: Changing the "forward" tear line
  • Next by thread: Re: AppleScript and Safari
  • Index(es):
    • Date
    • Thread