moving files to remote volume

I’ve done a search on this topic, but haven’t been able to find a workable solution for my situation.

I will be distributing a Filemaker database to users and need to get exports from that database back to my central Fileserver (OS X, 10.3). I can’t bet that all users will have the same setup on their machines (but I am willing, at this point, to restrict to just OS X users) so I cannot bet on file & folder layouts of each machine. I also don’t trust users not to delete an “unknown” folder they see and don’t recognize.

The original idea had been to have Filemaker do its exports into a (newly created, if necessary) directory in /Users/Shared (which I think is a safe bet to exist). Very few users will look in this directory, and even fewer will realize it’s important, so I believe the risk of deletion will be low.

Filemaker will likely do several exports while the database is open, so I need to allow for multiple files from that directory. In fact, I’d rather just take all files in that directory. The intended destination is my central OS X fileserver. I’m willing to take on assumption that all users are currently logged into that fileserver when Filemaker is running (I do a test when Filemaker is initially started up to check, and another test before Filemaker exits, before it writes the files).

So I’ve tried with this so far:


property destFolder : "afp://path.to.host/FileserveVol/Path/To/Destination/Export_Drop_Box"

property sourceFolder : "/Users/Shared/FMPro_Exports/"

tell application "Finder"
	try
		set filesToMove to every file of folder sourceFolder
		move filesToMove to folder destFolder
	on error e
		display dialog e
	end try
	
end tell

That should work, I think. However, I get an error: Finder got an error: Can’t get every file of folder “/Users/Shared/FMPro_Exports”.

Is this because it’s trying to move files to a remote volume? I would think (hope!) that the afp:// reference is legal inside Applescript. I also don’t quite understand why it can’t get every file in that particular folder. The folder does exist and files are inside it.

Any ideas? Thanks in advance!

As a matter of fact, AS can’t handle bare string slashy paths. Try either changing them to colon-delimited paths or making them file objects:

property destFolder : “afp://path.to.host/FileserveVol/Path/To/Destination/Export_Drop_Box” as posix file

property sourceFolder : “/Users/Shared/FMPro_Exports/” as posix file

Also, you can do the move immediately:

move (every file of folder sourceFolder to folder destFolder)