• 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: downloading a file into a folder (still)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: downloading a file into a folder (still)


  • Subject: Re: downloading a file into a folder (still)
  • From: Graff <email@hidden>
  • Date: Mon, 21 Feb 2005 22:15:00 -0500

2 main problems that I see.

First of all you have your "quoted form of" statement in the wrong place. It should be outside the "POSIX path of" statement.

Second you are using a POSIX-style path (the "/ "character) before you convert the entire path to POSIX-style. Thus the / is interpreted as part of the file name, not as part of the path. You need to use a Mac-style path delimiter instead (a ":" character)

Here is a corrected snippet, I moved around some stuff for clarity.

----
set this_URL to "http://www.latimes.com/cgi-bin/litsoft/litsoft.pl/today.puz";
set destFolder to ((path to desktop) as string) & "Puzzles To Do:"
set myFileName to thisYear & "-" & thisMonthNumber & "-" & thisDay & "-LATimes.puz"
do shell script ("curl " & this_URL & " -o " & quoted form of POSIX path of (destFolder & myFileName))
----


- Ken


On Feb 21, 2005, at 8:05 PM, Ed Rush wrote:

A week ago, I asked about downloading a file to a specific folder.

On 14 Feb 2005, at 11:30 AM, Emmanuel wrote:
..., I would trying adding "quoted form of " before "POSIX path".

On 14 Feb 2005, at 11:37 AM, Rob Stott wrote:
Probably the colon on the end of your folder name - a POSIX path uses slashes, not colons.

I am now rid of the curl error, but I still can't get the file into the folder.


On 16 Feb 2005, at 10:38 AM, Adam K. Wuellner wrote:
Put the path construction in parentheses?

Alas, that makes no difference. With or without the parentheses, I get a file on the desktop named
Puzzles To Do/2005-02-21-LATimes.puz
I thought it was impossible to have a slash in the file name, but there it is.


Here's my current code:

set this_URL to "http://www.latimes.com/cgi-bin/litsoft/litsoft.pl/today.puz";
set destFolder to "Puzzles To Do/"
set myFileName to thisYear & "-" & thisMonthNumber & "-" & thisDay & "-LATimes.puz"
do shell script ("curl " & this_URL & " -o " & POSIX path of (((path to desktop) as string) & quoted form of destFolder & myFileName))

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >downloading a file into a folder (From: Ed Rush <email@hidden>)
 >Re: downloading a file into a folder (From: Emmanuel <email@hidden>)
 >Re: downloading a file into a folder (still) (From: Ed Rush <email@hidden>)

  • Prev by Date: Re: downloading a file into a folder (still)
  • Next by Date: "Couldn't save document"
  • Previous by thread: Re: downloading a file into a folder (still)
  • Next by thread: Re: downloading a file into a folder (still)
  • Index(es):
    • Date
    • Thread