newbie question using alias reference for a fetch script

i’m trying to make a script to automate uploads using fetch. i’ve gotten it to work where the script uploads a folder on the desktop called “Upload”. however it copies the entire directory and its contents to a directory on the ftp server called “Upload”

i would rather that it go in and just copy all the files over to the root directory of the server but i’m not sure how to go about it. how do i make my “Uploads” variable a proper alias of all the files in said directory? here is my script:

set Uploads to alias ((path to desktop) as string) & “Upload”)
set login to text returned of (display dialog “Please enter your login name, all lower case with no spaces.” buttons {“Submit”} default answer “”)
if (login != “”) then
set myURL to (“ftp://” & login & “:” & login & “@ftp.server.com”)
tell application “Fetch 4.0.3”
activate
try
put into url myURL item Uploads
display dialog “FTP successful!” buttons {“Hooray!”}
quit
on error
display dialog "FTP was not successful. Please try re-running the script and check your login name. "
quit
end try
end tell

thanks in advance,
matt

can anyone help?

I don’t have Fetch but I’ll give it a shot. I would replace the first line with this:

set Uploads to ((path to desktop as Unicode text) & "Upload")
tell application "Finder" to set files_ to (files of folder Uploads) as alias list

This should give you a list of alias references for the files. I don’t know if you can just tell Fetch to upload the list (files_) or if you’ll need to use a repeat loop.

– Rob

Rob,

That worked perfectly. Thanks!

Matt