Your best friend for file transfer.

Fetch application logoFetch

Scripting Fetch (13 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 13 years ago by KitTempest
  • Latest reply 12 years ago from Jim Matthews
  • KitTempest Member

    Hi. I use Userland Frontier with Fetch to generate my web pages.

    I'm now helping an MIT group with their web page which required me to upgrade to 3.04bsec and connect using the KClient option.

    When Frontier tries to ftp, it attempts to use the cleartext option, even if I have a KClient session window open. So, if someone could just give me the AppleScript format that would tell Fetch to use the KClient method, I'm sure I could modify the Frontier ftp script to send that command to Fetch.

    Where do I find that info?

    Looking at the Fetch transcript, it seems all I really need to learn is how to tell Fetch the auth type I want to use:

    Connecting to ftp.dialup port 21 (12/18/01 1:21:37 PM)
    220 mit.edu FTP server (Version 5.60) ready.
    ADAT
    503 Must identify AUTH type before ADAT

    ----

    Here is the current script:

    on mkdir (host, path, user, password, url) { ÇMake directory
    return (appleEvent (Fetch.id, 'Arch', 'MkDr', 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url)))}

    ----

    Side note: For the CfA website I do at Harvard, I have to use a Mac MindTerm tunnel to ftp to it since Fetch isn't SSH yet ... it works with Fetch 3.0.3, but not 3.0.4 ... any ideas? (Error # -3155)

    [This message has been edited by KitTempest (edited 12-18-2001).]

    [This message has been edited by KitTempest (edited 12-18-2001).]

    [This message has been edited by KitTempest (edited 12-18-2001).]

    Posted 13 years ago #

  • Jim Matthews Administrator

    I would recommend using Fetch 4.0.1, since that's the latest version.

    The Apple Event you cite is from the Anarchie suite of events, and that suite does not provide a way to specify KClient authentication. So you would have to use the Fetch suite. The easiest way to generate the AppleScript syntax is to take the action manually with the Record button pressed in Script Editor.

    You might check to see if 4.0.1 solves the problem with tunnelling through MindTerm. Another possible option is MindTerm's ftp-to-sftp translator.

    Jim Matthews
    Fetch Softworks

    Posted 13 years ago #

  • KitTempest Member

    Ok, recording only works if I do it entirely manually (i.e., clicking on a shortcut doesn't cut it):

    create (new: 'cFWA', at: beginningOf (nil), withProperties: {"pHNm":"dialup.mit", "pUid":"my account", "pAut":'aGSS', "pEnc":true}

    Where is there a list of what is in the Fetch suite as opposed to the Anarchie suite? I posted the same question on the Frontier site and no answer yet, and the applescript site isn't helpful either.

    I've only seen such lists on the Filemaker site, and they've not yet updated their applescript guide to include switching personalities and the like. (Though I'll try your applescript recording trick and see if I can learn anything).

    Fetch 3.0.4b is the one MIT offers from their site currently ... tunnelling does work with Fetch 4.0.1!

    When you said 'MindTerm's ftp-to-sftp translator', did you mean the ftp-tosftp bridge? 'Cause that's what I've been using.

    Of course, MIT is still a problem since their dialup is only SSH1 and not SSH2 ...

    ----

    Grr ... it seems Frontier isn't using the create command to start the connection, nor a putInto type command to get the file in there.

    It's using a mkdir and store command, which I beg you're going to tell me are Anarchie suites that don't let me specify the encryption ...

    ppleEvent (Fetch.id, 'Arch', 'Stor', '----', alias (file), 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url))

    [This message has been edited by KitTempest (edited 12-18-2001).]

    [This message has been edited by KitTempest (edited 12-18-2001).]

    Posted 13 years ago #

  • Jim Matthews Administrator

    The best reference to the Fetch suite is its AppleScript dictionary (which you can open with Script Editor).

    I would try creating the transfer window using the Fetch suite (which lets you specify encryption), and then using the Anarchie suite commands -- Fetch should use the already-open transfer window.

    Jim Matthews
    Fetch Softworks

    Posted 13 years ago #

  • KitTempest Member

    Unfortunately life's not that easy. Frontier is sending the commands to Fetch, so Fetch does _not_ use an already open window.

    Each command Frontier sends, eg. change directory, etc., uses routines which I'm guessing are the Anarchy suite. I'm stuck with having to rewrite the whole way Frontier ftp's its pages (unless they come up with another set of glue scripts).

    I'm back to using Fetch 3.0.4 because Fetch 4 can't publish my web pages the normal way (unencripted). It gets to the proper directory where the file is to be transfered and generates a file not found error. Fetch 3.0.4 works even though it seems to open up an excessive number of windows. Both these behaviors result from the same commands being sent from Frontier.

    I'm still waiting for a response from the Frontier help site. Given the numbers of users who are most likely using Fetch, I'm surprised this hasn't been an issue before.

    I can't find any AppleScript Dictionary on my computer. Really I'm hoping for something as in-depth as the "Apple Events Reference" that came with Filemaker Pro explaining what and how they implimented their Apple Events. It gives an Object Map of implemented objects, Object Hierarchy, an Events and Objects matrix, and a list of FileMaker Objects and Events. I'd expect something like that hidden on your website somewhere so developers could know what to do ...

    Posted 13 years ago #

  • Jim Matthews Administrator

    Is there a trial copy of Frontier that I could use to experiment with this?

    To view Fetch's AppleScript dictionary, run Script Editor, choose "Open Dictionary..." from the File menu and select Fetch. The one thing it won't show is the four-character codes associated with each class, property, enumeration, etc. I can email those to you if you like.

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

  • KitTempest Member

    http://frontier.userland.com/ is their webpage. You have to email their customer service to get an evaluation copy.

    The 'Publish Page' script under the Web menu is the one that eventually calls the Fetch glue scripts which are located at system.verbs.apps.Fetch (use the Jump command to get there -- Command J)

    Posted 12 years ago #

  • KitTempest Member

    Ok, the 'Open Dictionary' command from the Script Editor has been very helpful and I've been able to construct a new script to ftp the compiled file securely. I'm curious why each time the 'put into' command is issued, a new window is made (the new window is securely opened), even though the old window is still open and active.

    put into remote directory "/mypath" item alias "myfile.shtml" format Automatic without uniquename authentication GSS

    I'm having some trouble getting it to cd to the proper directory with this command though. It puts the file at whatever level the window is currently viewing.

    Also, I've noticed that the script below generates an error if the open window already is open to that directory level (it opens a new window at the correct directory level, and then generates the error).

    tell application "Fetch 4.0.1"
    activate
    open remote item "/mypath"
    end tell

    [This message has been edited by KitTempest (edited 01-07-2002).]

    Posted 12 years ago #

  • Jim Matthews Administrator

    It could be that Fetch is opening a new window because the default setting for the encryption flag is different than what your open window has. You should be able to explicitly specify whether to encrypt or not in the put into statement, and that might take care of the extra window problem.

    I haven't seen the problem with put into putting the file in the wrong directory. Can you reproduce the problem on ftp.fetchsoftworks.com?

    The problem with the "open" command is that there's no way to specify whether to use encryption and authentication. I'll look into that.

    Thanks -- you may be the first person to try to do much scripting with secure connections.

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

  • KitTempest Member

    Well, as you can see from the command excerpt below, I specified GSS as the encryption method, and the already-open window had that same method. Even using the Script Editor to record what I'm doing and then play it back causes a new window to open even though when I did it manually, that didn't happen.

    put into remote directory "/mypath" item alias "myfile.shtml" format Automatic without uniquename authentication GSS

    As for reproducing the problem on ftp.fetchsoftworks.com, I get an error that I don't have permission to take that action unless I have already moved to the incoming directory in Fetch. If I'm at the top level, it tries to put it there rather than moving to the /incoming directory first.

    put into remote directory "/incoming/" item alias fileToFTP format Automatic without uniquename

    What I may end up doing is going back to using a "open remote item '/directory'" command before the "put into" command (because including a directory path in the put into command doesn't seem to have the effect of setting the directory where the file is to go). I can have my script check for errors and just ignore the one it gets when the window is already at the proper directory.

    >The problem with the "open" command is that
    >there's no way to specify whether to use
    >encryption and authentication. I'll look
    >into that.

    I've not had a problem with it per se as it is using the encryption method of the open window, even though it likes to make another window as well. The new windows that come up all are GSS encripted like my original one.

    Posted 12 years ago #

  • Jim Matthews Administrator

    There are two arguments you can pass with the put into event to specify security options: "authentication" (which you are using) and "encrypt". You might try:

    put into remote directory "/mypath" item alias "myfile.shtml" format Automatic without uniquename authentication GSS encrypt false

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

  • KitTempest Member

    Ok, so it doesn't matter what I say in the putInto command as regards authentication scheme or encryption format. It all depends on the currently open and frontmost window in Fetch.

    If that is my mit window using GSS and encrypt and I tell it putInto using KClient and no encrption, a new window is open with GSS and encryption on.

    Also, if the proper window isn't frontmost, for example, I had my www.blackirish.net window open using cleartext and no encryption, and tried to putInto the mit window, even though the mit window is open, if it's not frontmost, no files are transferred.

    If the mit window isn't open at all, I get the "specified object not found" from my putInto command:

    return (appleEvent (Fetch.id, 'FTCh', 'PutI', '----', objspec (obj), 'Itms', alias (item), 'TFmt', textFormat, 'BFmt', binaryFormat, 'Uniq', uniquename, 'pAut', authentication, 'pEnc', encrypt))

    Thus far the mit window (using GSS) always has new windows popping up (so I have a command to close a window after every ftp transfer). My blackirish.net window (using cleartext) has no new windows popping up.

    It's not the most elegant solution, but I can now get my work done using the latest version of Fetch as long as I open my connection using one of my shortcuts and make sure the proper window is frontmost.

    Later one I'll update the Frontier scripts and see if it can do the whole thing -- open the proper connection and transfer the file.

    Any news as to when SSL ftping will be available?

    Thanks for your help!

    Posted 12 years ago #

  • Jim Matthews Administrator

    Thanks for that follow-up; that isn't how it's supposed to work, and I'll see what I can do.

    SSL support won't come until after the next update, but hopefully it will be this year.

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

Topic closed

This topic has been closed.