Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript: Download files from the web? (LION)

Now in MAC OSX Lion, I am aware that URL Scripting is gone, and I am also aware that that used to be an easy way to do it. But how would you go about doing a script that could, say, download a .ZIP or .DMG file from the web? I assume you'd have to use cURL is some way?

Posted on Mar 12, 2013 8:00 PM

Reply
8 replies

Mar 12, 2013 10:15 PM in response to Camelot

I get this error:


% Total% Received % Xferd Average Speed TimeTime Time Current
Dload Upload Total SpentLeft Speed


0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file unstitcher.jar: Permission denied


8 133528 10990 0 2369 0 0:00:05 --:--:-- 0:00:05 2635

curl: (23) Failed writing body (0 != 1099)



Also, how would I save that file?

Mar 13, 2013 5:27 AM in response to Boboonski

The -O/--remote-name stuff truncates the path, and uses your current default path. curl does offer the --output switch (as well as the capability to pick filenames via # syntax within --output, if you want fill control), or you can invoke a shell script that does a cd and then the curl-whatever within the same script. (Don't try to invoke a cd and then separately invoke curl. That won't do what you want.) See man curl for details, or visit the curl web site for all sorts of details on curl.

Applescript: Download files from the web? (LION)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.