Copying from Synology Drive app to local drive fails

For those who don’t know, Synology Drive client is an app that allows you to mount remote NAS shares as server drives in Finder.

For the 1st time, I tried writing a script to copy files from the NAS server share, but it fails. Previously, I’ve been able to run scripts that rename files on the NAS without error.

Here’s the code:

set sourceFile to "/Users/acme/Library/CloudStorage/SynologyDrive-AcmeParts/widget1.jpg"
set destFolder to "/Users/acme/Documents"

tell application "Finder"
	copy file source to folder destFolder
end tell

The error is:

“widget1.jpg” couldn’t be copied to “Documents”.

Anyone know if it’s possible to directly copy to/from Synology Drive shares via Applescript?

About ‘copy’, Finder’s dictionary says “NOT AVAILABLE YET”.

You want ‘duplicate’. Caution: when duplicating between volumes the command does not return a usable reference to the duplicated item.

Also, your variable source isn’t defined and the Finder doesn’t understand POSIX paths.

set sourceFile to "/Users/acme/Library/CloudStorage/SynologyDrive-AcmeParts/widget1.jpg"
set destFolder to "/Users/acme/Documents"

tell application "Finder"
	duplicate file (sourceFile as POSIX file) to folder (destFolder as POSIX file)
end tell