Applescript to recursively visit all files

The Cyberduck forums have moved to Google Groups, this forum is read only.
Locked
clinch
Harmless
Posts: 2
Joined: Fri Jan 26, 2007 7:35 pm

Applescript to recursively visit all files

Post by clinch »

I'm trying to make a script which will recursively upload all the files and folders from a folder on my machine to a remote server. So far, I've successfully got a script working that can upload one file if I hard code that file name. I now want something that will accept a directory name, and then recurse through all the files of that directory and upload them, obviously maintaining the directory structure.

Here's what I have so far:

Code: Select all

tell application "Cyberduck"
	set theServer to "domain.com"
	set theUser to "user"
	set thePassword to "password"
	set theProtocol to "ftp"
	set theRemoteFolder to "public_html"
	set theLocalFolder to "~/Desktop/My Folder/"
	
	set theBrowser to (make new browser)
	with timeout of 300 seconds
		tell (theBrowser)
			set the encoding to "UTF-8"
			set show hidden to false
			connect to theServer with protocol theProtocol as user theUser with password thePassword
			change folder to theRemoteFolder
			
			-- Upload steps...
			
			disconnect
		end tell
	end timeout
end tell
THEM
Harmless
Posts: 1
Joined: Mon Nov 12, 2007 3:32 am

Post by THEM »

Did you ever figure out how to do this?
clinch
Harmless
Posts: 2
Joined: Fri Jan 26, 2007 7:35 pm

Post by clinch »

No. I just ended up teaching the user how to use FTP.

I wish I had figured it out though.
Locked