Page 1 of 1

Sync Sample Script

Posted: Wed Feb 14, 2007 7:42 pm
by sms26
The following sample script always prompts the user to press the 'syncronize' button. Is it possible to change the functionality so that the operation is silent.

Code: Select all

tell application "Cyberduck"
	set theServer to "my.ftp.co.uk"
	set theUser to "anonymous"
	set theProtocol to "ftp"
	set theRemoteFolder to "/mirror/source"
	set theLocalFolder to "_backups/"
	
	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
			change folder to theRemoteFolder
			sync folder (get working folder) with local folder theLocalFolder
			disconnect
		end tell
	end timeout
end tell
Thanks.