Archive script trouble


I’ve created a script that scans a network drive for folders. If there labeled green they will be moved to another destenation.
The script works when I test it locally with a limited number of folders. But when I run it on the network drive I get an apple event error.
Maybe there’s something wrong with my script. If somebody could take a look i’d be pleased.

with timeout of 7200 seconds
	mount volume "afp://user:password@ip-adress/volume/"
	delay 3
	set sourceFolder to alias "volume:folder"
	set destFolder to alias "volume:folder"
	set the log_file to ("volume:folder" as text) & "Script Error Log"
	tell application "Finder"
		set FolderList to (folders of entire contents of sourceFolder whose label index is 6)
		repeat with aFolder in FolderList
				copy aFolder to destFolder
			on error error_message number error_number
					set this_error to ("Error: " & error_number & ". " & ¬
						error_message & return & ¬
						aFolder as text) & return
					my write_to_file(this_error, log_file, true)
				end try
			end try
		end repeat
	end tell
end timeout

on write_to_file(this_data, target_file, append_data)
		set the target_file to the target_file as text
		set the open_target_file to ¬
			open for access file target_file with write permission
		if append_data is false then ¬
			set eof of the open_target_file to 0
		write this_data to the open_target_file starting at eof
		close access the open_target_file
		return true
	on error
			close access file target_file
		end try
		return false
	end try
end write_to_file

I’m surprised it ever works. The Finder’s copy instruction is not supported for files or folders. duplicate is the word of choice, and then when you’re happy with the move (perhaps checking for size or MD5 checksum), you delete the original. Further, assuming the network volume is an OS X machine, I’d use the Unix function mv to do the moving. See its man page.

Thanks for the reply.

The network volume is on a windows machine so the mv command is not possible.

For testing purposes I used the move command. But I wanted to do some final testing and replaced the move command with copy (my bad) but duplicate won’t work either.

Like I posted before: Moving green labeled folders works on my desktop. But when accesing a network volume the process stalls and finder locks up.