views:

25

answers:

1

Hello.

I have a folder on a server which is shared with guest access enabled. I want to be able to copy a file from that folder to a local machine with Applescript. So far I have:

property source : "server:sharedfolder:file.ext" property destination : "Macintosh HD:Users:User:Documents:Folder"

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

Which I think should work. But I get the error :Can't set folder source to destination number 10006. Any ideas?

Thanks.

A: 

Hi,

you need to remove the quotes around your declared properties:

property source : "server:sharedfolder:file.ext"
property destination : "Macintosh HD:Users:User:Documents:Folder:"

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

It is also good practice to terminate your folder paths with a ":".

HTH

Michel Lemieux