Fetch Upload Script

Hi I have a simple script for uploading files to a folder on my web site using Fetch. The script came with Fetch and I added a timeout because some of the files can be large. After I use the script I often get crashes particularly if I try to quit Fetch. I’m guessing the problem is with the timeout? Is there a better way of allowing for the full transfer?

on open doc
   with timeout of 3000 seconds
      tell application "Fetch 4.0.1"
         put into url {"ftp://username:passwd@hostdirectory"} item doc
      end tell
   end timeout
end open

Thanks Rob

You might want to put the timeout command around the “put into url” command only. That way, the timeout is applied only to the actual uploading portion of the program and is not spent on opening Fetch in the first place.

tell application "Fetch 3.0.2"
        activate
        with timeout of 30000 seconds --will affect only the file upload
                put into url "ftp://username:passwd@hostdirectory" item doc
        end timeout
        quit
end tell

: Hi I have a simple script for uploading files to a folder on my
: web site using Fetch. The script came with Fetch and I added a
: timeout because some of the files can be large. After I use
: the script I often get crashes particularly if I try to quit
: Fetch. I’m guessing the problem is with the timeout? Is there
: a better way of allowing for the full transfer?

: on open doc

: with timeout of 3000 seconds

: tell application “Fetch 4.0.1”

: put into url {“ftp://username:passwd@hostdirectory”}
: item doc

: end tell

: end timeout end open

: Thanks Rob