-- p1
set theURL to "http://localhost/zippy.zip"
--p2
set theFile to path of ("~/Desktop")
--3
tell application "URL Access Scripting"
download theURL to theFile
end tell
display dialog "Your download is complete"
I want to be able to choose where to download the file to. (In this case at the desktop.)
As long as I am scripting the Mac, URL Access Scripting was always somehow unreliable and I never really got it to work with my own scripts. This is why I suggest to use curl instead:
set theURL to "http://macscripter.net/ads_horiz/images/prmac_banner.gif"
set filepath to quoted form of POSIX path of (((path to desktop) as Unicode text) & "banner.gif")
set command to "curl " & theURL & " -o " & filepath
set output to do shell script command
if output is "" then
display dialog "Download ok!"
end if