• 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: URL access scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URL access scripting


  • Subject: Re: URL access scripting
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 13 Dec 2001 09:16:51 -0800

On 12/13/01 8:23 AM, I wrote:

> Well, I haven't used URL Access Scripting myself, but taking a quick look at
> its dictionary I don't see 'desktop' as one of its keyword parameters.
> Assuming (?) that the URL string is of a type that it likes, how about
> trying something that will return a file specification as its 'to' parameter
> says it requires? Will this work?
>
> download "ftp://ftp.MacOSphere.com/test.txt"; to (path to desktop)

Oops, that's the file spec for your desktop, not for the file you're
downloading. Sorry. You'll undoubtedly want the file to be called the same
thing, but better check you don't have a file of that name already:

set i to 0
set desktopPath to (path to desktop as string)
set preExtName to "test"
set done to false

repeat until done
set newFilePath to desktopPath & preExtName & ".txt"
try
get alias newFilePath -- if it doesn't error, you have one
set i to (i + 1)
set preExtName to "test" & i
on error -- means you don't have a file of this name yet
set done to true
end try
end repeat

tell application "URL Access Scripting"
download "ftp://ftp.MacOSphere.com/test.txt"; to file newFilePath
end tell

--
Paul Berkowitz


  • Follow-Ups:
    • Re: URL access scripting
      • From: Gnarlodious <email@hidden>
    • Re: URL access scripting
      • From: Michael Turner <email@hidden>
References: 
 >Re: URL access scripting (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: International text (Was: "as alias" and "as file spec...")
  • Next by Date: Adding 'balloon help' to scripts
  • Previous by thread: Re: URL access scripting
  • Next by thread: Re: URL access scripting
  • Index(es):
    • Date
    • Thread