• 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: download a PDF file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: download a PDF file


  • Subject: Re: download a PDF file
  • From: Doug McNutt <email@hidden>
  • Date: Sat, 31 Jan 2009 14:06:52 -0700

At 21:45 +0100 1/31/09, KOENIG Yvan wrote:
Hello

I try to download with a single script several iWork '09 User Guides.

This script downoad the stream but the saved file is wrong.
It seems that it's because it uses $0D as line breaks when the file must contain $0D + $0A


Is there a way to get a correct result?


--[SCRIPT] property p2d : ""

set p2d to path to desktop as text
(*
my downloadGuide("fr_FR", "Keynote", "Guide_de_l_utilisateur")
my downloadGuide("fr_FR", "Numbers", "Guide_de_l_utilisateur")
my downloadGuide("fr_FR", "Pages", "Guide_de_l_utilisateur")
my downloadGuide("en_US", "Keynote", "Use_Guide")
my downloadGuide("en_US", "Numbers", "Use_Guide")
*)
my downloadGuide("en_US", "Pages", "Use_Guide")

--=====

on downloadGuide(l, t1, t2)
	set fname to t1 & "09_" & t2 & ".pdf"
	set u to "http://manuals.info.apple.com/"; & l & "/" & fname
	set stream to do shell script ("curl " & quoted form of u)

tell application "Finder" to make new file at folder p2d with properties {name:fname}
write stream to file (p2d & fname) starting at 1
end downloadGuide


--[/SCRIPT]

I thought to cut the stream in paragraphs then concatenate all the items using $0D & $0A as text delimiter.

I hope that there is a better soluce.

Yvan KOENIG (from FRANCE samedi 31 janvier 2009 21:45:10)
_______________________________________________
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

--

--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
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
References: 
 >download a PDF file (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Move files to second monitor
  • Next by Date: Rép: download a PDF file
  • Previous by thread: Re: download a PDF file
  • Next by thread: Re: download a PDF file
  • Index(es):
    • Date
    • Thread