Error trying to duplicate a file

I am trying to duplicate a file from one folder to another on the same computer but am getting an error I cannot seem to figure out. It is occurring on the duplicate line of the script.

I have the error message posted below the part of the script that is getting the error. The script is trying to copy a file from the Profiles folder of the user ‘me’ and copy it to a folder on the Shared user. It seemed like a pretty basic thing to do, but I cannot figure out what is wrong. The error messages reads like it thinks the file is in the Shared user folder?

Any help would be appreciated. Thanks.

						if matched = false then
							duplicate file profileLocation to folder sharedProfiles
						end if

Here is the log with error message:

copy file "M08091993:Users:wrh2:Library:ColorSync:Profiles:blurg" to folder "M08091993:Users:Shared:Color Profiles:Profiles"
	--> error number -1728 from file "M08091993:Users:wrh2:Library:ColorSync:Profiles:blurg"

Result:
error “Finder got an error: Can’t set folder "M08091993:Users:Shared:Color Profiles:Profiles" to file "M08091993:Users:me:Library:ColorSync:Profiles:blurg".” number -10006 from folder “M08091993:Users:Shared:Color Profiles:Profiles”

Does “blurg” have a name extension?

Does the target folder exist in that exact location?

Is it because the copy would have the same name. I don’t know about using copy though. You might use 'duplicate".

Edited: i.e. you seem to be copying the file to the same folder that it’s in.

Edited: disregard my last edit.

Blurg is a .icc file. I did try adding the .icc to the name and received the same error.

All the paths and files exist as well.

Kel1,

I tried it with ‘copy’ instead of duplicate and the error is the same.

Including “.icc” in the file name is right. Using ‘copy’ instead of ‘duplicate’ is wrong.

That’s an odd name for a disk drive.

I’ve just been trying it myself. Duplicating from the current user folder to the Shared user folder definitely works. That error occurs if either of the paths is wrong ” that is if either the file or the target folder don’t exist with the specified name or in the specified location.

So I think it is fixed??? I just deleted the line with the duplicate command and retyped it. I compiled and then ran the script and now it seems to be working fine… very odd. Thanks for the help!

This is for a work computer and they name the computers that way. :slight_smile: