#	TransferCkid - Move the ckid resource from fromFile to toFile.
#
#	Usage:	TransferCKID fromFile toFile
#
#	TransferCKID moves the ckid resource (if it exists) from the
#	first file to the second file. 
#
#	© Apple Computer, Inc. 1988 - 1990
#	All rights reserved.

Set Exit 0
	
#	Check the parameters

If {#} ≠ 2
	Echo "### Usage - {0} fromFile toFile" > dev:stderr
	Exit 1
End
	
#	Check if files exist

For name in "{1}" "{2}"
	If "`Exists -f "{name}"`"==""
		Echo "### {0}" - File "'{name}'" does not exist. > dev:stderr
		Exit 2
	End
End

Begin

	#	Transfer the ckid
	
	Echo "Include ∂"{1}∂" 'ckid';" | Rez -m -a -o "{2}"
	If {Status} == 0
		Echo "Delete 'ckid';" | Rez -a -o "{1}"
	End
End
