Cyberduck Issue

Hey,

I’m trying to script Cyberduck to upload a file to a specific folder.

I’m modifying this script:

http://bbs.applescript.net/viewtopic.php?id=23537

But instead of having this as a folder action, I’m going to tie this either to an automator action or Butler, and have the script upload the files that are currently selected in the finder”but I keep on getting the “can’t make xxx into right class” error.

Here’s my script; suggestions?

tell application "Finder"
	set ItemList to selection
end tell
set theServer to "[url=ftp://ftp.xxxxxxxx.com]ftp.xxxxxxxx.com[/url]"
set theUser to "xxxxxxxx"
set theProtocol to "ftp"
set theUploadFolder to "client"



with timeout of 300 seconds
	tell application "Cyberduck"
		set theBrowser to (make new browser)
		tell (theBrowser)
			set encoding to "UTF-8"
			connect to theServer with protocol theProtocol as user theUser with initial folder theUploadFolder
			repeat with thisItem in ItemList
				upload item thisItem
			end repeat
		end tell
	end tell
end timeout

I’m guessing again. Try this instead:

tell application "Finder"
	set ItemList to selection as alias list -- instead of the Finder style references that need to be coerced to an alias
end tell

Also, like you other issue, try just upload thisItem.

Brilliant! :smiley:

I tried “set as alias” but I didn’t know about the “alias list” thingy.

If I add “Quit Cyberduck” to the end of this script, it will quit before it’s done uploading”any ideas on that besides “delay”?

Thanks

How about a loop that checks the size of the file on the FTP against the size on your local drive. When they are equal, Cyberduck can quit.