Your best friend for file transfer.

Fetch application logoFetch

Upload all files in a folder (3 posts)

This is an archived topic. The information in it is likely to be out-of-date and no longer applicable to current versions of Fetch.
  • Started 20 years ago by timothyt
  • Latest reply 20 years ago from timothyt
  • timothyt Member

    I am new to AppleScripting.
    I am looking to create a script that uploads every file of a folder. Here is what I have tried:
    tell application "Fetch 4.0.2"
    geturl ""
    get {every file of the folder, "Macintosh HD:Users:timothyt:Desktop:test2:"}
    copy selection to transfer window ""
    end tell
    When I run this, I get an invalid key form error.
    What should I change?


    Posted 20 years ago #

  • Jim Matthews Administrator

    This should work:

    tell application "Finder"
    set fileList to every file of folder "Macintosh HD:Users:timothyt :Desktop:test2:"
    end tell

    tell application "Fetch 4.0.3"
    repeat with oneFile in fileList
    put into url "ftp://userid :password@hostname/path/" item (oneFile as alias)
    end repeat
    end tell

    The "oneFile as alias" part is needed because the Finder will give back a list of file references, while Fetch wants to deal with aliases.


    Jim Matthews
    Fetch Softworks

    [This message has been edited by JimMatthews (edited 07-23-2003).]

    Posted 20 years ago #

  • timothyt Member

    Works like a charm, thanks for the help and the quick response.

    Posted 20 years ago #

Topic closed

This topic has been closed.