Renaming zip file - not sticking - Please Help!!

I have a script where I am copying a zip file to a folder. Then renaming the zip file and then opening the zip file. I would assume that by renaming the zip file before opening or unarchiving it that the folder created by the unarchiving process would be the new file name. However, It seems as if since the upgrade to Mac OS X the unarchiving process is getting the name that the file was initially.


on CopyandUnZipFile(fileStructureToCustomerOrder, theFile, theFileName)
	tell application "Finder"
		copy file (theFile as string) to folder (fileStructureToCustomerOrder as string)
		copy file (theFile as string) to folder (fileStructureToCustomerOrder & "Template:" as string)
		set RenameFile to (fileStructureToCustomerOrder & theFileName) as alias
		set the name of RenameFile to "Proofs.zip"
		set FiletoOpen to fileStructureToCustomerOrder & "Proofs.zip"
		open FiletoOpen as alias
	end tell
end CopyandUnZipFile

Your help would be VERY appreciated

Wishful thinking won’t get you anywhere most of the time.

Is this a handler in a larger script, or is this the script itself?
Confused :frowning:

Yes, This is a handler in a much larger script. Each of those variables has a value. Also, while stepping through the code - I can see the file name get changed. But when I step through the open file line it names the folder that it creates to unarchive the zip file back to the original name.

Thanks in advance.

sample variables:
fileStructureToCustomerOrder = folder to base location where this stuff is happening
theFile = the full file i.e. “Macintosh HD:blah:10097.zip”
theFileName = 10097.zip

Rename the extracted folder AFTER it unzips. OSX doesn’t know any better.
-N