Need a script to download a picture every 10 minutes

Hello!

I am a newbie so i hope you could help me.
I need a script to download a picture from a ftp server every 10 minutes. How do i script that?
I have to do this manually on my job so i hope i can get a script to do it for me.
I have tryed the Url Access Scripting app to download the pics, but it will not download from the frp server. Should i use a different app?

Thanks!

Hi!

This should work:

set theImg to "ftp://user:password@ftp.server.com/img.gif"
set localFile to (choose file name default name "img.gif")

do shell script "curl " & quoted form of theImg & " -o " & quoted form of POSIX path of localFile

To execute this code every 10 minutes, simply add an idle handler and save your script as stay-open:

global theImg, localFile

set theImg to "ftp://user:password@ftp.server.com/img.gif"
set localFile to (choose file name default name "img.gif")

on idle
	do shell script "curl " & quoted form of theImg & " -o " & quoted form of POSIX path of localFile
	return 600 --> seconds
end idle

This is working great!
Thanks a lot for the help!