Script for backing up files

Hi,
I’m very new to AppleScript, but know a little.:expressionless:
Can someone tell me a simple script so I can drop a folder into the AppleScript icon I have made (on open) and it will automatically be moved to at least 2 other servers or volumes?
Thank you.

Hi jdg,

welcome :slight_smile:

working with servers there is no “simple” solution, because you need
at least a routine to mount the volume if it’s not available.
Here is a minimal script to move the files/folders to local volumes and server volumes,
but there is no real error handling or a check if the files/folders already exist on the destination volume.
Also if there are folders with many files in it, I would recommend to use the shell to copy the data

property localVolumes : {"volume1", "volume2"}
property theServers : {"afp://user:pass@myServer1/sVol1", "afp://user:pass@myServer2/sVol2"}
property ServVols : {"sVol1", "sVol2"}

on open theseFiles
	repeat with i in localVolumes
		tell application "Finder" to move theseFiles to (i as alias)
	end repeat
	repeat with i from 1 to count theServers
		if item i of ServVols is not in (do shell script "ls /Volumes") then
			try
				mount volume item i of theServers
				tell application "Finder" to move theseFiles to (item i of ServVols as alias)
			end try
		end if
	end repeat
end open

Thanks, Stefan,
I will give it a try.
jdg:)