Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have AppleScripts that run on a schedule to download files from URLs. They had been using URL Access Scripting.app's download event, which now looks to have disappeared from Lion.

I can't find any documentation telling me what happened to it, or what the way forward is. The AppleScript release notes cover Snow Leopard, but not Lion (not yet, at least), and Mac OS X Automation's Lion Applescript page only mentions new features. Is URL Access Scripting.app still hiding someplace, or do I need to find a new way to download a file to disk?

share|improve this question
    
I just heard about this, and I am using Lion now. Where can I download this tool? It's nowhere on Apple's servers that can find, or in my old Snow Leopard machines. –  user14398 Dec 1 '11 at 13:38
    
@PeterPayne Read the answer already posted. –  Dov Dec 1 '11 at 13:55

1 Answer 1

up vote 9 down vote accepted

Apple eliminated URL Access Scripting.app in Lion for unknown reasons, and obviously hasn't released any documentation on why they did so or workarounds. Additionally, if you copy over the app, it will appear but it still won't work.

Likely the best workaround until documentation is released (although I wouldn't be surprised to see others recommend this) is to change your scripts to use curl. Editing the scripts should be fairly simple, and curl is actually quite reliable and useful.

If you don't know curl, you should be able to figure it out fairly quickly, it's nothing too challenging. Here is an example of a script that was converted (by another user) to curl. My apologies if it isn't exactly the same as your scripts, but you should be able to get a few ideas from the block of code.

-- Using URL Access Scripting
set myFile to ((path to temporary items) as string) & "url_access_file.xml"
tell application "URL Access Scripting"
download "http://whateverlink.com" to file myFile
end tell

-- Using curl
set myFile to (POSIX path of (path to temporary items)) & "curl_file.xml"
do shell script "curl -L " & "http://whateverlink.com" & " -o " & myFile
share|improve this answer
    
My script downloads images (specifically, see URL interfacelift.com/wallpaper/7yz4ma1/…), and curl isn't working. It doesn't download anything. I'm not sure if I need custom headers, or what's going on... –  Dov Aug 8 '11 at 15:56
1  
It turns out I needed to pass in the -A flag with a user agent string. That looks like: -A "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50" –  Dov Aug 8 '11 at 16:11
    
That's great that you got this to work in curl! –  SoFLy Sep 13 '11 at 15:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.