Posted on Fri - January 13, 2006

Weather Maps


The original version of this script is in YOURDISC/Library/Scripts/URLs. It's a nice piece of work, but it does have one flaw. The original holds the codes for both a temperature and an isobar map, but it can only display one at a time. I want both, even if I only look at them for about thirty seconds a day.

So of course I had to modify a bit and then experiment to see what tweaks worked best.

The script is simple.

set temperature_map to "acttemp_720x486.jpg" -- temperatures
set weather_map to "curwx_720x486.jpg" -- surface isobars
set the target_URL to "http://maps.weather.com/images/maps/current/" & temperature_map
set the destination_file1 to ((path to desktop as string) & "tempermap.jpg")
tell application "URL Access Scripting"
download target_URL to file destination_file1 replacing yes
end tell
set the target_URL to "http://maps.weather.com/images/maps/current/" & weather_map
set the destination_file to ((path to desktop as string) & "weathermap.jpg")
tell application "URL Access Scripting"
download target_URL to file destination_file replacing yes
end tell
tell application "Finder" to open alias destination_file
tell application "Finder" to open alias destination_file1

That is all there is to it, I just set my other scripts to make a call to this one.

It's not perfect though. When I get time I want to change the download spot from the desktop to Users/Shared/Shared Desktop Pictures so every account can run the script or call up the latest pictures. I really don't like keeping files on my desktop unless I am working on them.

www.teknopagan.com
       



teknologi
© 2005 - 2008 All Rights Reserved