0
votes

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.

2

2 Answers

3
votes

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

0
votes

Your current script reads: "Copy the variable source to the variable destination." I'm assuming you don't want to just change the variables around; you're using the wrong command. See my answer to this question to learn more.