Duplicating Packages

Why do I get an error whenever I try to tell the Finder to duplicate a folder that is a package? The following script snippet works flawlessly:

tell application "Finder"
	duplicate folder ¬
		"Alice:Users:chuck:Documents:TestFolder" to folder ¬
		"Alice:Users:chuck"
end tell

But, if I rename TestFolder to TestFolder.key (adding the extension for Keynote packages) and alter the script appropriately, I get an error -10006, "Finder got an error: Can’t set folder “Alice:Users:chuck” to folder “Alice:Users:chuck:Documents:TestFolder.key”.

Using an extention that doesn’t indicate that the folder is a package (such as “.dir”) also works fine.

Am I going to have to use a do script and have it use the cp command?

Thanks,
Chuck

Finder does not concibes a package as a folder, but as file:

tell application "Finder"
	duplicate file "myDiskName:Applications:iTunes.app:" to folder "myDiskName:"
end tell

Both “myDiskName:Applications:iTunes.app” and “myDiskName:Applications:iTunes” work here, too… :wink:

Thanks, JJ. I had figured it out finally. I also found out that to copy files to a package I had to rename the package without the extension. The Finder then thinks that it’s a folder. When I’m finished copying files into the package, I name it back to it’s original, package indicating name.

Thanks,
Chuck