Your best friend for file transfer.

Fetch application logoFetch

Copy replacing? (3 posts)

  • Started 3 years ago by Gil
  • Latest reply 3 years ago from Gil
  • Gil Member

    Recording with AppleScript Editor, dragging a file from a remote file icon in the transfer window to a local Finder window produced:

    copy remote file "RemoteFileName" to beginning of alias "Path:To:TempFilesFolder"

    It works fine, but I cannot seem to find the 'copy' command in the sdef dictionary.

    In particular, does it have anything like a "replacing <yes/no>" feature, or does one test first? The default behavior of 'copy' on finding an existing file appears to be to change the name.

    To test for a file's existence, can one ask Fetch to do this or must one use the Finder?

    --Gil

    Posted 3 years ago #

  • Jim Matthews Administrator

    Hi Gil,

    Fetch does not support a "replacing <yes/no>" option for the AppleScript "copy" command; it always uses its default behavior, which is governed by the "Overwrite files with conflicting names" checkbox in the Download section of Preferences. By default, that box is unchecked, and Fetch will give the downloaded file a new name. You can check it temporarily in AppleScript, e.g.:

    set overwrite files to true
    copy remote file "RemoteFileName" to beginning of alias "Path:To:TempFilesFolder"
    set overwrite files to false

    I hope this helps,

    Jim Matthews
    Fetch Softworks

    Posted 3 years ago #

  • Gil Member

    Perfect! Thanks, Jim!

    --Gil

    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.