Your best friend for file transfer.

Fetch application logoFetch

Scripting Samples (4 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 10 years ago by MikeBro
  • Latest reply 10 years ago from Jim Matthews
  • MikeBro Member

    Deciphering AppleScript syntax from application dictionaries is often difficult for me and I only found a very small number of sample files that were provided with this program. They don’t pertain to what I am trying to accomplish.

    Is there some way to find more samples? 3rd party websites? I can't seem to find any on the internet. Do you know of any?

    Posted 10 years ago #

  • Jim Matthews Administrator

    One source on the Internet is the applescript-users mailing list that Apple runs. You can search the archives at http://www.lists.apple.com/search It's also a good place to ask AppleScript questions.

    When I'm trying to figure out AppleScript syntax my first step is to try to record a script (press the Record button in the Script Editor and then perform the steps manually in Fetch).

    I hope this helps,

    Jim Matthews
    Fetch Softworks
    --
    p.s. Here's a sample script; it's actually the script I have run every day (by iDo Script Scheduler) to remove big and old files from the incoming directory at ftp.fetchsoftworks.com:

    set curDate to the current date
    tell application "Fetch 4.0.3"
    open url "ftp://fsw:@delsi.pair.com/%2fusr/public_ftp/fsw/incoming/"
    set allnames to name of every remote file
    repeat with aname in allnames
    set aname to (aname as string)
    if size of remote file aname > 1000000 or ¬
    modification date of remote file aname < curDate - 60 * days then
    delete remote file aname
    end if
    end repeat
    end tell

    Posted 10 years ago #

  • MikeBro Member

    Jim:
    Thanks....Your extra sample helped. I'm trying to compare the modification date of remote files to the modification dates of files with the same names on a local machine. If the local files do not exist, or if there is a newer version on the remote site, the files are to be downloaded.

    Thanks again,
    Mike

    Posted 10 years ago #

  • Jim Matthews Administrator

    Have you tried using the Mirror Folder command in the Remote menu (it can also be recorded into a script)? That's what it is supposed to do, and if it worked for you it would simplify your script tremendously.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 10 years ago #

Topic closed

This topic has been closed.