tell me why 1 works and the other doesn't

can someone please tell me why

tell application “Finder” to duplicate folder (alias “STURM:Users:iconan:Desktop:scripts:”) to ¬
folder (alias “STURM:Users:iconan:Desktop:dev. stuff:”)

works and this doesn’t

tell application “Finder” to duplicate folder (alias “STURM:Users:iconan:”) to folder (alias “STURM:Users:iconan:Desktop:G4BACKUPS:”)

i get the following Execution Error
“Finder got an error:The operation could not be completed.”

thank you

I think you’ll find that if you try to drag ‘STURM:Users:iconan:’ to the desktop, it will fail also. I reckon there’s some type of fatal loop that would happen since the user folder contains the desktop that you are trying to duplicate to. :shock:

what i am trying to do is redo one of my os9 scripts that i use for backing up and breing it into osX. a variation of this script used to work, i have “dumbed” it down a little bit to make my point and get advice. so is there a way around this? terminal maybe and do shell scripts?

it also fails when trying to duplicate other folders eg.: library and system folders.

I’m not familiar enough with the shell to answer. Can you duplicate to a destination outside of the user’s domain?

I agree with Rob, you can’t duplicate a folder to a location contained within such folder. Instead, you can duplicate the folder, then move it to whatever location you wish:

tell app "Finder"
     set x to (duplicate alias "path:to:user folder:")
     move x to alias "path:to:user folder:user subfolder:"
end tell