Copy & Compare

Hi, I want to create a script can copy file to specific location then compare to make sure 2 files are the same.
I use file size as compare item, but command “get physical size” doesn’t work.
Maybe some one have other idea can fix my script?
thank in advance!!!


tell application "Finder"
	set fileSelected to choose file with prompt "Please select a file for testing!"
	
	set a to get physical size of item fileSelected as integer
	set nameSelected to name of fileSelected as string
	
	set temp to display dialog "What do you want to do?" buttons {"Duplicate", "Move", "Cancel"} default button 3
	
	set folderSelected to choose folder with prompt "Choose the folder you want to store!"
	set folderPath to folderSelected as string
	
	set buttonReturned to the button returned of temp
	if buttonReturned is "Duplicate" then
		duplicate fileSelected to folderSelected
	else if buttonReturned is "Move" then
		move fileSelected to folderSelected
	end if
	delay 1
	beep
	display dialog "Complete " & buttonReturned buttons {"OK"} default button 1
	
	set fileCompleted to folderPath & nameSelected
	set x to fileCompleted as alias
	set b to get physical size of item x as integer
	
	--compare section-----------------------------
	set temp2 to display dialog "Do you want to compare the file after testing?" buttons {"Yes", "No"} default button 2
	set buttonReturned2 to the button returned of temp2
	delay 1
	if buttonReturned2 is "Yes" then
		if a is equal to b then
			display dialog "There are same!!!
Physical size(byte) of file is:" & a with icon caution
		else
			display dialog "The two files have something different,Please check!!!" with icon stop
		end if
	end if
	------------------------------------------------------
	
	--compress section------------------------------
	set temp3 to display dialog "May be you need a compress tool?" buttons {"Yes", "No"} default button 2
	set buttonReturned2 to the button returned of temp3
	if buttonReturned2 is "Yes" then
		
		set ToBeZippedFile to (POSIX path of (choose folder with prompt "Choose the folder you want to zip"))
		set zipfolder to (POSIX path of (choose folder with prompt "Where do you want to store the zip file?") & "fileCompressTest.zip")
		
		do shell script "zip -r -j " & zipfolder & " " & ToBeZippedFile & ""
		
	end if
	--------------------------------------------------------
end tell
tell application "Finder"
	display dialog "Complete!!!" buttons {"Byebye"} default button 1
end tell

Model: MacBook (White)
Browser: Safari 525.28.3
Operating System: Mac OS X (10.5)