Re: Tell Safari to Download pdf?
Re: Tell Safari to Download pdf?
- Subject: Re: Tell Safari to Download pdf?
- From: Philip Aker <email@hidden>
- Date: Wed, 25 Jun 2008 15:56:30 -0700
On 08-06-25, at 15:47, Kevin Walzer wrote:
Ken G. Brown wrote:
Anyone know how to tell Safari to download a pdf at something like http://www.xyz.com/file.pdf
, to the downloads directory?
I can get it to load into the Safari window, and if I could save it
from there, that might work. Can't even seem to do that at the
moment.
But I would rather download it directly into the desired place like
you are able to from the contextual menu, Save Linked File As:.
Thanks for any tips. Ken G. Brown
Safari probably isn't the best tool for this.
I'd try something like this:
set theURL to "http://www.xyz.com/file.pdf"
do shell script "curl " & theURL & " -o ~/Downloads/file.pdf"
I agree but my curl usage is slightly different:
do shell script "cd ~/Downloads;curl -O http://www.xyz.com/file.pdf"
In addition, in case the user has specified a different download
folder than the default, you can get it with:
do shell script "defaults read com.apple.Safari DownloadsPath"
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden