MacOS Applescript – Locating ‘URL Access Scripting.app’ in Lion

applescriptmacos

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?

Best Answer

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