Apple script not working to copy a file to a mounted network folder

Hi everyone, my first post :cool:. I am very new to applescript and I need help. This is actually very urgent help for someone starting a small business.

I have a script that works if I copy a file from one directory to another but only on a local computer. If I modify the script to copy the file to a mounted network folder I get an error. "Can’t set “SCOTT:Users:SCOTT:Documents” to file “112:Users:Scott:documents:test.MOV”

Working code


set source to "112:Users:Scott:Documents:test.MOV"
set destination to "112:Users:Shared"
tell application "Finder"
duplicate file source to destination
end tell

Not Working code


set source to "112:Users:Scott:Documents:test.MOV"
set destination to "SCOTT:Users:Scott:Documents"
tell application "Finder"
duplicate file source to destination
end tell

The script is run from an iMac G3 OSX 10.3.9 called AMOS-Room 202 with volume 112 as its only storage drive. Remote apple events is turned on :smiley:
On AMOS-Room202 I am logged in as account Scott and have mounted and authenticated volume SCOTT which is through a network server connection to a G4 OSX 10.2 computer named David Farley’s Computer which I am also logged in as account Scott and remote events is also turned on.:smiley:

My request for assistance is more conceptual in nature. The source and destination paths are not critical, I just want to understand how this is done and achieve some working code. I think it has something to do with the path syntax going to the SMB mounted drive.

You could have 2 problems. First this line…

duplicate file source to destination

“destination” is just a string (even though it represents the path to a folder). The Finder doesn’t understand strings as paths to files/folders. So just put the keyword “folder” in front of it to make it correct. Notice that you put the keyword “file” in front of “source”, and you need to add the keyword with destination too.

duplicate file source to folder destination

Understanding what I just said, I don’t think the code you posted as “working” really works because it has the same problem.

Finally, your destination path might be wrong too. Here’s an easy way to get the string path to a folder (you could do something similar for a file). Just run this, choose the folder, and look at the result for the path. So you should validate your destination path to make sure it’s correct.

(choose folder) as text

Note: you do not need remote apple events turned on for this to work because you have mounted the drive locally, so remote events isn’t being used here.

BLESS YOU regulus6633!!! Thank you thank you thank you thank you!!! mange tak!

By sharing with me the "(CHOOSE FOLDER) as text script I was able to discover that my mounted volume started in SCOTT:Users:Scott

So I changed the code to just duplicate to “SCOTT:Documents” that I discovered with the choose folder command and it worked!!

I spent about 6-7 hours trying to fix this and with your help was able to discover in just minutes. Thank you so much.

(P.S. the code did work without designating “Folder” before the “destination” string variable but I did add it just to make the code more accurate and complete)

Final Working script to transfer file trough a network mount


set source to "112:Users:Scott:Documents:test.MOV"
set destination to "SCOTT:Documents"
tell application "Finder"
duplicate file source to folder destination
end tell

I’m happy to help… selv tak. :smiley: