Download Web Image for Control Page

Posted on
Sat May 01, 2010 9:10 am
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Download Web Image for Control Page

This might be useful for someone like me who is a code weenie that would like
to display web images on their control pages.

You will need to download SiteSucker and set it's Replace Files pref to "Always"
and of course season the script(s) to taste.

Code: Select all
tell application "SiteSucker"
    activate
    download "http://www.nps.gov/webcams-glac/apvccam.jpg"
end tell

tell application "SiteSucker"
    quit
end tell

set sourceFile to ((path to downloads folder as text) & "www.nps.gov:webcams-glac:apvccam.jpg")
set target_path to ((path to application support folder as text) & "Perceptive Automation:Indigo 4:IndigoWebServer:images:controls:variables:webcam+apgar.png")

try
    tell application "Image Events"
        launch
        set theImage to open alias sourceFile
        scale theImage to size 480
        save theImage as PNG in target_path with icon
        close theImage
    end tell
on error e
    display dialog e
end try

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests