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

Re: AppleScript and Safari


  • Subject: Re: AppleScript and Safari
  • From: Dave Balderstone <email@hidden>
  • Date: Tue, 09 Nov 2004 08:59:30 -0600


On Nov 9, 2004, at 7:05 AM, Steve Suranie wrote:

Any help is appreciated.

Here's a script I use to download a 24 hour weather summary every night. It may help:


----------
 -- watch line wrap

set theDate to current date
set t to time of theDate
if t > 83700 then
set d to day of theDate as string
set m to month of theDate as string
set y to year of theDate as string
set theFileName to "Weather_" & d & "_" & m & "_" & y & ".html"

set f to "" & (path to desktop) & "weather:"
set thefile to POSIX path of f & theFileName
set vURL to "\"http://www.weatheroffice.ec.gc.ca/forecast/ 24_hour_conditions_e.html?yxe&unit=m\" " -- watch line wrap

set theWeather to "curl " & vURL & "-o " & thefile
try
do shell script theWeather

on error
set TheError to f & "ErrorLog.txt"
try
close access file TheError
end try
open for access file TheError with write permission
write theFileName & " failed to be written. " & ((current date) as string) & return & return to file TheError starting at eof
-- watch line wrap
close access file TheError

end try
end if
----------


_______________________________________________
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>
References: 
 >AppleScript and Safari (From: "Steve Suranie" <email@hidden>)

  • Prev by Date: Re: AppleScript and Safari
  • Next by Date: Re: AppleScript and Safari
  • Previous by thread: Re: AppleScript and Safari
  • Next by thread: Re: AppleScript and Safari
  • Index(es):
    • Date
    • Thread