Re: URL access scripting
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