I used to be able to download URLs from an Applescript, but I lost the Applescript. I want to enter a URL: i.e.: "http://wpclassic.com/go.php?http://www.revolutiontwo.com/download/tv.zip" and have it prompt for a place to put the file.

-
–  ghoppe Aug 8 '11 at 20:54
@ghoppe Sort of, but I'm using SL. –  daviesgeek Sep 17 '11 at 15:44

set the URLs to the text returned of (display dialog "Enter the URLs you would like to download. If you have more than one, separate them with commas please:" default answer "")
set the destination to (choose folder with prompt "Choose the folder you want to download the URLs to:")
set AppleScript's text item delimiters to ","
repeat with this_URL in the URLs
tell application "URL Access Scripting" to download this_URL to the destination with progress and unpacking
end repeat
set AppleScript's text item delimiters to ""


If you are using Lion, the above code won't work (Apple removed URL Access Scripting for some reason). Use the shell command curl instead, as shown below:

set the URLs to the text returned of (display dialog "Enter the URLs you would like to download. If you have more than one, separate them with commas please:" default answer "")
set the destination to (choose folder with prompt "Choose the folder you want to download the URLs to:")
set AppleScript's text item delimiters to ","
repeat with this_URL in the URLs
do shell script "curl -L " & this_URL & " -o " & POSIX path of the destination
end repeat
set AppleScript's text item delimiters to ""

-
Just so you know...there should be a parenthese on the first line after "default answer""". –  daviesgeek Aug 10 '11 at 16:57
@daviesgeek Wow did not see that. Thanks I will fix it. :) –  fireshadow52 Aug 10 '11 at 20:46
You are very welcome. –  daviesgeek Aug 10 '11 at 21:27
AppleScript Editor gives me: error "URL Access Scripting got an error: Unsupported scheme" number -30774 –  daviesgeek Sep 6 '11 at 15:50
I think this worked. I will have to check to see if it did. –  daviesgeek Jan 25 '12 at 19:17