Your best friend for file transfer.

Fetch application logoFetch

Newbie scripter needs help (4 posts)

  • Started 3 years ago by PVS
  • Latest reply 3 years ago from Jim Matthews
  • PVS Member

    I have written a script that downloads files from the Internet. After much searching, I have been unable to figure out how to 1) make the download happen in the background (no windows popping up); and 2) rename the files in the destination folder. I feel like it's probably a simple syntax problem. Any help would be greatly appreciated. I am using Fetch 4.0.3 on OSX 10.4.11 on G5 PowerPC. Thanks.

    Posted 3 years ago #

  • Jim Matthews Administrator

    Hi,

    The trick to keeping the application you are scripting in the background is to make sure you don't include any "activate" statements.

    Could you post the script that you have now, along with some more information on what you want to rename the downloaded files to? I would be happy to help with the AppleScript syntax.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 3 years ago #

  • PVS Member

    Jim, Thanks for your quick reply. Here is what I am working with to this point:

    tell application "Fetch"
    set overwrite files to true
    copy remote file myWebFile to beginning of alias myDownloadLocation
    set overwrite files to false
    quit
    end tell

    The transfer window appears when I run this. I get rid of it with the quit command.

    RIght now I have to rename the file with the Finder after download. Is there a way to rename during download?

    Thanks again for your help.

    PVS

    Posted 3 years ago #

  • Jim Matthews Administrator

    Here's a script that would also rename the file:

    tell application "Fetch"
    set overwrite files to true
    copy remote file myWebFile to beginning of alias myDownloadLocation
    set overwrite files to false
    quit
    end tell
    tell application "Finder"
    set name of file myWebFile of folder myDownloadLocation to "new file name"
    end tell

    Does that work?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 3 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.