path problem with duplicate

keep getting error
“Finder got an error: Handler can’t handle objects of this class.”
it makes the folder but will not copy

set fname to text returned of (display dialog "enter your first name:" default answer "First name")
set lname to text returned of (display dialog "enter your Last name:" default answer "Last Name")
set locname to fname & lname
set localpath to "Macintosh HD:Users:computerservices:" & locname & ":"

tell application "Finder"
	make new folder at folder "computerservices" of folder "Users" of startup disk with properties {name:locname}
	duplicate folder "Macintosh HD:Users:computerservices:pictures:" to localpath with replacing
end tell

thanks
s

The next thing I would try is:

duplicate every file in folder "Macintosh HD:Users:computerservices:pictures:" to localpath with replacing

and see if that does the trick.

Good Luck

Craig Smith

Hi,

Also, localpath is a string:

set localpath to “Macintosh HD:Users:computerservices:” & locname & “:”

so you may need to add ‘folder’ before local path to coerce it to a reference. You don’t need to do that though, because you can just get the result of the ‘make’ command:

set localpath to (make new folder at folder “computerservices” of folder “Users” of startup disk with properties {name:locname}) as alias

Coercing to alias is not necessary, but the alias reference has an advantage.

gl,