Page 1 of 1

Questions on Applescript and Cyberduck

Posted: Thu Sep 17, 2009 6:36 am
by brandon_r87
Hello,

I'm trying to write an Applescript that will upload the files I've selected to my ftp server and I'm having several issues. I'm currently running Cyberduck 3.3b2 on Snow Leopard. The first error I get is at make new browser. The error is "The handler some object is not defined." If I comment out lines related to that, my script runs without error but doesn't seem to actually do anything. I added in a dialog to display working folder, but I get an error that Cyberduck can't get the current working folder. It seems to me that its not connecting, but I don't know that for sure. Is there a way I can get the script to tell me if it was successful in connecting?

Thanks,
Brandon

Code: Select all

-- connect to ftp
tell application "Cyberduck"
   set theServer to "xxxxxx"
   set theUser to "xxxxxx"
   set thePassword to "xxxxxx"
   set theProtocol to "ftp"
   set theUploadFolder to "/music"
   
   activate
   --set theBrowser to (make new browser) --Applescript Error: Cyberduck got an error: The handler some object is not defined.
   --tell (theBrowser)
   connect to theServer with protocol theProtocol as user theUser with password thePassword with initial folder theUploadFolder
   --display dialog browser working folder -- Cyberduck got an error: Can't get working folder
   --end tell
end tell

-- upload the selected songs
tell application "iTunes"
   if selection is not {} then
      set sel to a reference to selection
      repeat with aTrack in sel
         set aArtist to (get artist of aTrack)
         set aName to (get name of aTrack)
         set aAlbum to (get album of aTrack)
         set aFile to (get location of aTrack)
         tell application "Cyberduck"
            change folder to theUploadFolder
            change folder to aArtist
            change folder to aAlbum
            upload item aFile
         end tell
      end repeat
   end if
end tell

-- disconnect from ftp
tell application "Cyberduck"
   disconnect
end tell

Re: Questions on Applescript and Cyberduck

Posted: Thu Sep 17, 2009 8:07 pm
by dkocher
As stated in the release notes AppleScript is currently not supported for the Snow Leopards beta builds.

Re: Questions on Applescript and Cyberduck

Posted: Thu Sep 17, 2009 8:18 pm
by brandon_r87
Thanks, my bad for not reading the release notes.