What's wrong with this script?

Discussion in 'Mac Programming' started by thriftinkid, Apr 11, 2008.

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #1
    Hey guys. I'm trying to upload all the quicktimes from a folder on my desktop called "finished" to my ftp. After trying mutiple ways including, automator actions, terminal shell scripts, and an ftp application called "cute ftp" I have still not solved my problem. The files start to upload and freeze up, or dont upload at all. I am now trying an ftp program called cyberduck. I wrote the following applescript. It's not working, but I am filling what looks like all the necessary info the cyberduck dictionary commands state. Any ideas?

    applescript:

    tell application "Cyberduck" to launch
    tell application "Cyberduck" to connect as user "myusername"
    tell application "Cyberduck" to connect to "myhostname"
    tell application "Cyberduck" to connect with connect mode "ftp"
    tell application "Cyberduck" to connect with initial folder "/myftpsite/quicktimedestinationfolder"
    tell application "Cyberduck" to connect with password "mypassword"
    tell application "Cyberduck" to connect with port "21"
    tell application "Cyberduck" to connect with protocol "ftp"
    tell application "Cyberduck" to upload item "macintosh hd/Users/John/Desktop/Finished/*.mov"
    tell application "Cyberduck" to disconnect
     
  2. thread starter macrumors regular

    Joined:
    Mar 24, 2008
    #2
    I have a new script, but it is still not working quite right. ANy Ideas?

    script



    -- remote stuff
    set theServer to "comcastnetwork.tv"
    set theProtocol to "ftp"
    set theUser to "csftp@cntv"
    set theRemoteFolder to "/comcastadmin/sitewwwroot/johntest"
    set connectmode to "passive"

    tell application "Finder"
    set theFolder to "MacintoshHD:Users:comcastcable:Desktop:Finished" as alias
    set theList to name of (every file in theFolder)
    end tell
    -- upload the image and thumbs with Cyberduck
    try
    tell application "Cyberduck"
    activate
    set theBrowser to (make new browser)
    try
    tell (theBrowser)
    set encoding to "default"
    connect to theServer with protocol theProtocol as user theUser with initial folder theRemoteFolder
    upload theList

    disconnect
    end tell
    on error error_message
    display dialog error_message
    end try
    quit
    end tell
    on error error_message
    display dialog error_message
    end try
     

Share This Page