Your best friend for file transfer.

Fetch application logoFetch

Why doesn't this work? (8 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 12 years ago by skunkworks
  • Latest reply 12 years ago from skunkworks
  • skunkworks Member

    I'm updating an applescript to control Fetch 4.0.1 under OSX10.1.2

    The line:

    make new remote directory at beginning with properties {name:FileDir}

    produces a "descriptor type mismatch occurred" error. FileDir is a text item (strictly speaking, it is a text item pulled from a file path, split by setting Applescript's Text Item Delimiters).

    This line used to work under OS9 and Fetch 3.0.3. Why not now?

    Posted 12 years ago #

  • Jim Matthews Administrator

    You might try substituting (FileDir as text) for FileDir; does that help? Does it work if you type the directory name in the script (e.g. substitute "newdir" for FileDir)?

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

  • skunkworks Member

    Thanks for your reply. The answers to your questions were "no" and "yes".

    OK - let's look at the code segment again. DirName is a text item from a string.

    display dialog (class of Dirname) as text
    tell application "Fetch 4.0.1"
    make new remote directory at beginning with properties {name:DirName}
    open remote directory DirName
    end tell

    The dialog displays "string" as the class of DirName. The script then dies at the make new remote directory line with the error:

    Fetch 4.0.1 got an error: a descriptor type mismatch occurred

    How can DirName be class string but Fetch complain it's getting a type mismatch?

    Assume DirName is "test". If I replace DirName with "test" in this line Fetch will create the directory, but at the next line (open remote directory DirName) I get:

    Fetch 4.0.1 got an error: Invalid key form.

    I'm going crazy trying to debug this. I'd be grateful for any clues. Is there possibly a bug in Fetch?

    Thanks.

    Posted 12 years ago #

  • Jim Matthews Administrator

    Are you running Mac OS 9.2.2, with AppleScript 1.7? That version of AppleScript passes some string variables to applications as Unicode strings. Fetch isn't ready for that, so the references fail. I'd think that (DirName as text) or (DirName as international text) would convert them to a form that Fetch could handle, but apparently not. Fetch 4.0.2 will be able to handle Unicode in these situations, and I believe that AppleScript 1.8.x may do things differently.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

  • skunkworks Member

    I'm running OSX 10.1.2 and AppleScript 1.7.

    This code segment is part of a subroutine, and the list of files to be uploaded by Fetch is passed to it. If I cut-and-paste the subroutine into a new standalone script with a fixed list of files (text array) rather than a file list passed to it, the routine seems to work.

    Something funny is going on with the references - is there any AppleScript coercion that you know of that could fix this problem? DirName as text didn't work as you know.

    Thanks.

    Posted 12 years ago #

  • Jim Matthews Administrator

    You might try (DirName as international text) or (DirName as string) -- are they any better?

    Posted 12 years ago #

  • skunkworks Member

    I'm afraid neither of these work - "Fetch 4.0.1 got an error: a descriptor type mismatch occurred".

    We'll I'm beat on this one. Nothing I've tried has worked. If I set DirName in the subroutine to a fixed text item it works. If I set it to the directory name extracted from the file list it does not work regardless of the coercion.

    My last desperate idea is to open up a disk file, write DirName to it, read it back in as a text item and try that.

    Posted 12 years ago #

  • skunkworks Member

    If you're interested I could email the whole Applescript to you - but I suspect you have enough on your plate without wanting to investigate this one in detail.

    Cheers.

    Posted 12 years ago #

Topic closed

This topic has been closed.