• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tell Safari to Download pdf?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Tell Safari to Download pdf?
      • From: Alan Fairlie <email@hidden>
References: 
 >Tell Safari to Download pdf? (From: "Ken G. Brown" <email@hidden>)
 >Re: Tell Safari to Download pdf? (From: Kevin Walzer <email@hidden>)

  • Prev by Date: Re: Tell Safari to Download pdf?
  • Next by Date: Re: Tell Safari to Download pdf?
  • Previous by thread: Re: Tell Safari to Download pdf?
  • Next by thread: Re: Tell Safari to Download pdf?
  • Index(es):
    • Date
    • Thread